public DbFixtureInitDb(bool clear = false) { _clear = clear; DataAdapter = new EfCore.OeEfCoreDataAdapter <OrderContext>(); MetadataProvider = new ModelBuilder.OeEdmModelMetadataProvider(); var modelBuilder = new ModelBuilder.OeEdmModelBuilder(DataAdapter, MetadataProvider); EdmModel = modelBuilder.BuildEdmModel(); }
public DbFixtureInitDb(bool clear = false) { _clear = clear; DataAdapter = new EfCore.OeEfCoreDataAdapter <OrderContext>(OrderContextOptions.Create(true)); var dbContext = (DbContext)DataAdapter.CreateDataContext(); MetadataProvider = new EfCore.OeEfCoreEdmModelMetadataProvider(dbContext.Model); DataAdapter.CloseDataContext(dbContext); var modelBuilder = new ModelBuilder.OeEdmModelBuilder(DataAdapter, MetadataProvider); EdmModel = modelBuilder.BuildEdmModel(); }