Files
reallife-gamemode/ReallifeGamemode.Database/Entities/GroupVehicle.cs
2020-03-17 20:21:41 +01:00

22 lines
564 B
C#

using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using Microsoft.EntityFrameworkCore;
using ReallifeGamemode.Database.Models;
namespace ReallifeGamemode.Database.Entities
{
public partial class GroupVehicle : ServerVehicle
{
public Group Group { get; set; }
[ForeignKey("Group")]
public int? GroupId { get; set; }
public override string ToString()
{
using (var dbContext = new DatabaseContext())
return "Gruppen Fahrzeug | Gruppe: " + dbContext.Groups.First(g => g.Id == GroupId).Name;
}
}
}