2 bug fixes which prevented saving to db

This commit is contained in:
Robert McRackan 2019-12-16 10:32:38 -05:00
parent 95ae8335a1
commit c7891dc448
2 changed files with 2 additions and 1 deletions

View File

@ -21,6 +21,7 @@ namespace ApplicationServices
using var context = DbContexts.GetContext(); using var context = DbContexts.GetContext();
var libImporter = new LibraryImporter(context); var libImporter = new LibraryImporter(context);
var newCount = await Task.Run(() => libImporter.Import(items)); var newCount = await Task.Run(() => libImporter.Import(items));
context.SaveChanges();
Serilog.Log.Logger.Debug($"Import: New count {newCount}"); Serilog.Log.Logger.Debug($"Import: New count {newCount}");
await Task.Run(() => SearchEngineCommands.FullReIndex()); await Task.Run(() => SearchEngineCommands.FullReIndex());

View File

@ -13,7 +13,7 @@ namespace DtoImporterService
public ImporterBase(LibationContext context) public ImporterBase(LibationContext context)
{ {
ArgumentValidator.EnsureNotNull(DbContext, nameof(context)); ArgumentValidator.EnsureNotNull(context, nameof(context));
DbContext = context; DbContext = context;
} }