[#79] Entities: Remove EF proxies
This commit is contained in:
@@ -27,13 +27,15 @@ namespace Elwig.Models.Entities {
|
||||
public virtual ICollection<WbGem> Gems { get; private set; } = null!;
|
||||
|
||||
[InverseProperty(nameof(Parent))]
|
||||
public virtual ICollection<WineOrigin> Children { get; private set; } = null!;
|
||||
public virtual ICollection<WineOrigin> RealChildren { get; private set; } = null!;
|
||||
[NotMapped]
|
||||
public List<WineOrigin> Children { get; private set; } = [];
|
||||
|
||||
public int Level => (Parent?.Level + 1) ?? 0;
|
||||
|
||||
public string HkIdLevel => $"{new string(' ', Level * 2)}{HkId}";
|
||||
|
||||
public int TotalChildNum => 1 + Children.Select(c => c.TotalChildNum).Sum();
|
||||
public int TotalChildNum => 1 + Children.Sum(c => c.TotalChildNum);
|
||||
|
||||
private int SortKey1 => (Parent?.SortKey1 ?? 0) | (TotalChildNum << ((3 - Level) * 8));
|
||||
public int SortKey => SortKey1 | ((Level < 3) ? (-1 >>> (Level * 8 + 8)) : 0);
|
||||
|
||||
Reference in New Issue
Block a user