[#79] Entities: Remove EF proxies
This commit is contained in:
@@ -21,12 +21,11 @@ namespace Elwig.Windows {
|
||||
}
|
||||
|
||||
protected override async Task OnRenewContext(AppDbContext ctx) {
|
||||
var origins = (await ctx.WineOrigins
|
||||
.Include("Gems.AtGem.Kgs.WbKg.Gl")
|
||||
.AsSplitQuery()
|
||||
.ToListAsync())
|
||||
.OrderByDescending(o => o.SortKey)
|
||||
.ThenBy(o => o.HkId);
|
||||
var origins = await ctx.WineOrigins
|
||||
.Include(o => o.Gems).ThenInclude(g => g.AtGem.Kgs).ThenInclude(k => k.WbKg!.Gl)
|
||||
.ToListAsync();
|
||||
origins.ForEach(o => { origins.FirstOrDefault(p => p.HkId == o.ParentHkId)?.Children.Add(o); });
|
||||
origins = [.. origins.OrderByDescending(o => o.SortKey).ThenBy(o => o.HkId)];
|
||||
ControlUtils.RenewItemsSource(WineOrigins, origins, WineOrigins_SelectionChanged);
|
||||
if (WineOrigins.SelectedItem == null) {
|
||||
var hkid = await ctx.WbKgs
|
||||
@@ -39,8 +38,7 @@ namespace Elwig.Windows {
|
||||
}
|
||||
var gls = await ctx.WbGls
|
||||
.OrderBy(g => g.GlNr)
|
||||
.Include("Kgs.Rds")
|
||||
.AsSplitQuery()
|
||||
.Include(g => g.Kgs).ThenInclude(k => k.Rds)
|
||||
.ToListAsync();
|
||||
ControlUtils.RenewItemsSource(WbGls, gls, WbGls_SelectionChanged, ControlUtils.RenewSourceDefault.First);
|
||||
UpdateWbGems();
|
||||
|
||||
Reference in New Issue
Block a user