fix house

This commit is contained in:
hydrant
2019-07-16 20:42:05 +02:00
parent 976c285662
commit 3082b0bab2
10 changed files with 2606 additions and 19 deletions

View File

@@ -26,18 +26,11 @@ namespace ReallifeGamemode.Server.Entities
[NotMapped]
public Vector3 Position => new Vector3(X, Y, Z);
[ForeignKey("User")]
public int? UserId { get; set; }
public User User { get; set; }
[ForeignKey("Owner")]
public int? OwnerId { get; set; }
public User Owner { get; set; }
[NotMapped]
public Client Owner
{
get
{
using (var dbContext = new DatabaseContext())
return dbContext.Users.Where(u => u.Id == this.UserId).FirstOrDefault()?.Client;
}
}
public Client User => Owner?.Client;
}
}