Umstrukturierung
This commit is contained in:
25
ReallifeGamemode.Database/Entities/GroupVehicle.cs
Normal file
25
ReallifeGamemode.Database/Entities/GroupVehicle.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
using ReallifeGamemode.Database.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace ReallifeGamemode.Database.Entities
|
||||
{
|
||||
public 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.GroupVehicles.Include(g => g.Group).First(g => g.Id == this.Id).Group.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user