Bug fix #231 : Some books without categories are not getting imported

This commit is contained in:
Robert McRackan 2022-04-15 16:30:43 -04:00
parent bfceb58d6b
commit c8c0ffeb0d
2 changed files with 4 additions and 2 deletions

View File

@ -3,7 +3,7 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<Version>6.7.6.2</Version> <Version>6.7.7.1</Version>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -121,7 +121,9 @@ namespace DtoImporterService
: item.Categories[1].CategoryId; : item.Categories[1].CategoryId;
// This should properly be SingleOrDefault() not FirstOrDefault(), but FirstOrDefault is defensive // This should properly be SingleOrDefault() not FirstOrDefault(), but FirstOrDefault is defensive
var category = DbContext.Categories.Local.FirstOrDefault(c => c.AudibleCategoryId == lastCategory); var category
= DbContext.Categories.Local.FirstOrDefault(c => c.AudibleCategoryId == lastCategory)
?? Category.GetEmpty();
Book book; Book book;
try try