Context Load Navigations and Collections

This commit is contained in:
2025-07-21 12:24:54 +02:00
parent 93d3878b07
commit f2bc48bc52
10 changed files with 91 additions and 14 deletions

View File

@@ -13,6 +13,10 @@ public class MoveMangaLibraryWorker(Manga manga, FileLibrary toLibrary, IEnumera
return []; //TODO Exception?
if (DbContext.FileLibraries.Find(LibraryId) is not { } toLibrary)
return []; //TODO Exception?
DbContext.Entry(manga).Collection(m => m.Chapters).Load();
DbContext.Entry(manga).Navigation(nameof(Manga.Library)).Load();
Dictionary<Chapter, string> oldPath = manga.Chapters.ToDictionary(c => c, c => c.FullArchiveFilePath);
manga.Library = toLibrary;