Bug fix: Defensive FirstOrDefault. #194
This commit is contained in:
parent
426391f01c
commit
1f8a5b256e
@ -3,7 +3,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Version>6.6.5.1</Version>
|
||||
<Version>6.6.6.1</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@ -120,7 +120,8 @@ namespace DtoImporterService
|
||||
// 2+
|
||||
: item.Categories[1].CategoryId;
|
||||
|
||||
var category = DbContext.Categories.Local.SingleOrDefault(c => c.AudibleCategoryId == lastCategory);
|
||||
// This should properly be SingleOrDefault() not FirstOrDefault(), but FirstOrDefault is defensive
|
||||
var category = DbContext.Categories.Local.FirstOrDefault(c => c.AudibleCategoryId == lastCategory);
|
||||
|
||||
Book book;
|
||||
try
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user