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)); }
public override void PreConfigureServices(ServiceConfigurationContext context) { TestServiceEfCoreEntityExtensionMappings.Configure(); }