示例#1
0
        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();
        }
示例#2
0
        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();
        }