[#43] App: Use FileSystemWatcher to renew contexts on demand
This commit is contained in:
@ -100,8 +100,7 @@ namespace Elwig.Windows {
|
||||
SaveButton.IsEnabled = hasChanged;
|
||||
}
|
||||
|
||||
private async Task RefreshGraphList() {
|
||||
using var ctx = new AppDbContext();
|
||||
private async Task RefreshGraphList(AppDbContext ctx) {
|
||||
PaymentVar = await ctx.PaymentVariants.FindAsync(Year, AvNr) ?? throw new ArgumentException("PaymentVar not found");
|
||||
Season = await ctx.Seasons.FindAsync(Year) ?? throw new ArgumentException("Season not found");
|
||||
|
||||
@ -201,8 +200,8 @@ namespace Elwig.Windows {
|
||||
FillingInputs = false;
|
||||
}
|
||||
|
||||
protected override async Task OnRenewContext() {
|
||||
await RefreshGraphList();
|
||||
protected override async Task OnRenewContext(AppDbContext ctx) {
|
||||
await RefreshGraphList(ctx);
|
||||
}
|
||||
|
||||
private void InitPlot() {
|
||||
|
Reference in New Issue
Block a user