[#79] Entities: Remove EF proxies

This commit is contained in:
2026-04-01 16:24:03 +02:00
parent 4460de9975
commit 9c39a2f820
50 changed files with 471 additions and 413 deletions

View File

@@ -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();