BaseDataWindow: Fix data renewal
This commit is contained in:
@ -19,7 +19,9 @@ namespace Elwig.Windows {
|
||||
private bool _attrUpdate = false;
|
||||
|
||||
private async Task WineAttributesInitEditing(AppDbContext ctx) {
|
||||
_attrList = new(await ctx.WineAttributes.OrderBy(a => a.Name).ToListAsync());
|
||||
_attrList = new(await ctx.WineAttributes
|
||||
.OrderBy(a => a.Name)
|
||||
.ToListAsync());
|
||||
_attrs = _attrList.ToDictionary(a => a.AttrId, a => (string?)a.AttrId);
|
||||
_attrIds = _attrList.ToDictionary(a => a, a => a.AttrId);
|
||||
ControlUtils.RenewItemsSource(WineAttributeList, _attrList);
|
||||
@ -27,7 +29,9 @@ namespace Elwig.Windows {
|
||||
}
|
||||
|
||||
private async Task WineAttributesFinishEditing(AppDbContext ctx) {
|
||||
ControlUtils.RenewItemsSource(WineAttributeList, await ctx.WineAttributes.OrderBy(a => a.Name).ToListAsync());
|
||||
ControlUtils.RenewItemsSource(WineAttributeList, await ctx.WineAttributes
|
||||
.OrderBy(a => a.Name)
|
||||
.ToListAsync());
|
||||
_attrList = null;
|
||||
_attrs = null;
|
||||
_attrIds = null;
|
||||
|
Reference in New Issue
Block a user