Defensive FirstOrDefault
This commit is contained in:
parent
d636ceed8e
commit
0a986238bc
1 changed files with 1 additions and 1 deletions
|
|
@ -68,7 +68,7 @@ namespace DtoImporterService
|
|||
|
||||
foreach (var item in importItems)
|
||||
{
|
||||
var book = DbContext.Books.Local.SingleOrDefault(p => p.AudibleProductId == item.DtoItem.ProductId);
|
||||
var book = DbContext.Books.Local.FirstOrDefault(p => p.AudibleProductId == item.DtoItem.ProductId);
|
||||
if (book is null)
|
||||
{
|
||||
book = createNewBook(item);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue