formatted code
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
using System;
|
||||
using ReallifeGamemode.Server.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace ReallifeGamemode.Server.Entities
|
||||
@@ -8,6 +11,17 @@ namespace ReallifeGamemode.Server.Entities
|
||||
{
|
||||
public Group Group { get; set; }
|
||||
|
||||
[ForeignKey("Group")]
|
||||
public int? GroupId { get; set; }
|
||||
|
||||
public Group GetGroup()
|
||||
{
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
return dbContext.Groups.Where(g => g.Id == GroupId).FirstOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "Gruppen Fahrzeug | Gruppe: " + Group.Name;
|
||||
|
||||
Reference in New Issue
Block a user