Пример #1
0
        public TestServiceMigrationDbContext CreateDbContext(string[] args)
        {
            TestServiceEfCoreEntityExtensionMappings.Configure();

            var configuration = BuildConfiguration();

            //确认执行迁移到TestService数据库
            var builder = new DbContextOptionsBuilder <TestServiceMigrationDbContext>()
                          .UseSqlServer(configuration.GetConnectionString("TestService"));

            return(new TestServiceMigrationDbContext(builder.Options));
        }
Пример #2
0
 public override void PreConfigureServices(ServiceConfigurationContext context)
 {
     TestServiceEfCoreEntityExtensionMappings.Configure();
 }