diff --git a/Source/LibationAvalonia/Dialogs/TrashBinDialog.axaml.cs b/Source/LibationAvalonia/Dialogs/TrashBinDialog.axaml.cs index 98faa355..c2dd2221 100644 --- a/Source/LibationAvalonia/Dialogs/TrashBinDialog.axaml.cs +++ b/Source/LibationAvalonia/Dialogs/TrashBinDialog.axaml.cs @@ -122,7 +122,8 @@ namespace LibationAvalonia.Dialogs private void Reload() { - var deletedBooks = DbContexts.GetContext().GetDeletedLibraryBooks(); + using var context = DbContexts.GetContext(); + var deletedBooks = context.GetDeletedLibraryBooks(); DeletedBooks.Clear(); DeletedBooks.AddRange(deletedBooks.Select(lb => new CheckBoxViewModel { Item = lb })); diff --git a/Source/LibationWinForms/Dialogs/TrashBinDialog.cs b/Source/LibationWinForms/Dialogs/TrashBinDialog.cs index 2a5fdac8..06b7abd2 100644 --- a/Source/LibationWinForms/Dialogs/TrashBinDialog.cs +++ b/Source/LibationWinForms/Dialogs/TrashBinDialog.cs @@ -23,7 +23,8 @@ namespace LibationWinForms.Dialogs deletedCheckedTemplate = deletedCheckedLbl.Text; - var deletedBooks = DbContexts.GetContext().GetDeletedLibraryBooks(); + using var context = DbContexts.GetContext(); + var deletedBooks = context.GetDeletedLibraryBooks(); foreach (var lb in deletedBooks) deletedCbl.Items.Add(lb);