This commit is contained in:
1 parent
bc419ce57a
commit
065fbc2eea
16 files changed
+161
-53
No files matched your search
@@ -19,7 +19,7 @@ namespace Elwig.Windows {
|
||||
private bool _branchUpdate = false;
|
||||
|
||||
private async Task BranchesInitEditing(AppDbContext ctx) {
|
||||
_branchList = new(await ctx.FetchBranches().ToListAsync());
|
||||
_branchList = [with(await ctx.FetchBranches().ToListAsync())];
|
||||
_branches = _branchList.ToDictionary(b => b.ZwstId, b => (string?)b.ZwstId);
|
||||
_branchIds = _branchList.ToDictionary(b => b, b => b.ZwstId);
|
||||
ControlUtils.RenewItemsSource(BranchList, _branchList);
|
||||
@@ -50,7 +50,7 @@ namespace Elwig.Windows {
|
||||
.Where(_branchIds.ContainsKey)
|
||||
.Select(b => {
|
||||
b.ZwstId = _branchIds[b];
|
||||
ctx.Entry(b).State = EntityState.Added;
|
||||
ctx.Entry(b).State = EntityState.Modified;
|
||||
return b;
|
||||
}));
|
||||
await ctx.SaveChangesAsync();
|
||||
|
||||
Reference in new issue
Block a user