added editorconfig and formatted code

This commit is contained in:
hydrant
2019-07-17 19:52:55 +02:00
parent ada071cc93
commit 123ab7d07b
146 changed files with 10839 additions and 10715 deletions

View File

@@ -10,31 +10,31 @@ using System.Linq;
namespace ReallifeGamemode.Server.Entities
{
[Table("UserVehicles")]
public class UserVehicle : ServerVehicle
[Table("UserVehicles")]
public class UserVehicle : ServerVehicle
{
[ForeignKey("User")]
public int UserId { get; set; }
public User User { get; set; }
public override string ToString()
{
[ForeignKey("User")]
public int UserId { get; set; }
public User User { get; set; }
public override string ToString()
{
return "Spieler Fahrzeug | Besitzer: " + GetOwner().Name;
}
public User GetOwner(DatabaseContext dbContext = null)
{
if (dbContext == null)
{
using (dbContext = new DatabaseContext())
{
return dbContext.Users.FirstOrDefault(u => u.Id == UserId);
}
}
else
{
return dbContext.Users.FirstOrDefault(u => u.Id == UserId);
}
}
return "Spieler Fahrzeug | Besitzer: " + GetOwner().Name;
}
public User GetOwner(DatabaseContext dbContext = null)
{
if (dbContext == null)
{
using (dbContext = new DatabaseContext())
{
return dbContext.Users.FirstOrDefault(u => u.Id == UserId);
}
}
else
{
return dbContext.Users.FirstOrDefault(u => u.Id == UserId);
}
}
}
}