31 lines
750 B
C#
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;
|
|
}
|
|
}
|
|
}
|