Revert "Remove items from library."
This reverts commit 00f7e4b7796c724192e4246c0498e6b183782f18.
This commit is contained in:
parent
35fc3581b3
commit
81195e382e
@ -35,10 +35,7 @@ namespace DtoImporterService
|
||||
// CURRENT SOLUTION: don't re-insert
|
||||
|
||||
var currentLibraryProductIds = DbContext.Library.Select(l => l.Book.AudibleProductId);
|
||||
var audibleLibraryProductIds = importItems.Select(i => i.DtoItem.ProductId);
|
||||
|
||||
var newItems = importItems.Where(dto => !currentLibraryProductIds.Contains(dto.DtoItem.ProductId));
|
||||
var removedItems = DbContext.Library.Where(l => !audibleLibraryProductIds.Contains(l.Book.AudibleProductId));
|
||||
|
||||
foreach (var newItem in newItems)
|
||||
{
|
||||
@ -58,10 +55,7 @@ namespace DtoImporterService
|
||||
u.UpdateAccount(item.AccountId);
|
||||
}
|
||||
|
||||
DbContext.Library.RemoveRange(removedItems);
|
||||
|
||||
var qtyNew = newItems.Count();
|
||||
var qtyRemoved = removedItems.Count();
|
||||
return qtyNew;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user