Files
reallife-gamemode/ReallifeGamemode.Server/Entities/GroupVehicle.cs
Lennart Kampshoff a88d5256a8 formatted code
2019-05-05 17:59:11 +02:00

31 lines
750 B
C#

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
{
public class GroupVehicle : ServerVehicle
{
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;
}
}
}