private void EnsureCreation(DbContextOptions <CatalogContext> contextOptions) { using (var context = new TestCatalogContext(contextOptions)) { context.Database.EnsureCreated(); } }
public CatalogDataContextFactory() { ContextOptions = new DbContextOptionsBuilder <CatalogContext>() .UseInMemoryDatabase(Guid.NewGuid().ToString()) .EnableSensitiveDataLogging() .Options; EnsureCreation(ContextOptions); ContextInstance = new TestCatalogContext(ContextOptions); }