Scan Bugfixes (#177)
* Added way more logging for debugging issue #163. Fixed #175 * Removed some comment that isn't needed * Fixed a enumeration issue due to removing while enumerating
This commit is contained in:
parent
09a953be8c
commit
2b99c8abfa
3 changed files with 47 additions and 38 deletions
|
@ -17,7 +17,7 @@ namespace API.Data
|
|||
/// <summary>
|
||||
/// This will remove any entries that have chapterIds that no longer exists. This will execute the save as well.
|
||||
/// </summary>
|
||||
public async Task<bool> CleanupAbandonedChapters()
|
||||
public async Task<int> CleanupAbandonedChapters()
|
||||
{
|
||||
var chapterIds = _context.Chapter.Select(c => c.Id);
|
||||
|
||||
|
@ -26,7 +26,7 @@ namespace API.Data
|
|||
.ToListAsync();
|
||||
|
||||
_context.RemoveRange(rowsToRemove);
|
||||
return (await _context.SaveChangesAsync()) > 0;
|
||||
return await _context.SaveChangesAsync() > 0 ? rowsToRemove.Count : 0;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue