Remove reliance on persistent Account objects across boundaries. If you open an account persister, then dispose of it

This commit is contained in:
Robert McRackan 2020-08-27 23:05:46 -04:00
parent 20b6f28cb5
commit 60f1d8117d
11 changed files with 42 additions and 39 deletions

View file

@ -51,15 +51,16 @@ namespace ApplicationServices
{
Dinah.Core.ArgumentValidator.EnsureNotNull(account, nameof(account));
var localeName = account.Locale?.Name;
Log.Logger.Information("ImportLibraryAsync. {@DebugInfo}", new
{
account.AccountName,
account.AccountId,
LocaleName = account.Locale?.Name,
LocaleName = localeName,
});
var dtoItems = await AudibleApiActions.GetAllLibraryItemsAsync(account, callback);
return dtoItems.Select(d => new ImportItem { DtoItem = d, Account = account }).ToList();
return dtoItems.Select(d => new ImportItem { DtoItem = d, AccountId = account.AccountId, LocaleName = localeName }).ToList();
}
private static async Task<int> getNewCountAsync(List<ImportItem> importItems)