using Microsoft.EntityFrameworkCore; using ReallifeGamemode.Server.Models; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ReallifeGamemode.Server.Entities { public class JobVehicle : ServerVehicle { public virtual Job Job { get; set; } public override string ToString() { using (var dbContext = new DatabaseContext()) return "Job Fahrzeug | Job: " + dbContext.JobVehicles.Include(j => j.Job).First(j => j.Id == this.Id).Job.Name; } } }