コード例 #1
0
        public MyProjectMigrationsDbContext CreateDbContext(string[] args)
        {
            MyProjectEfCoreEntityExtensionMappings.Configure();

            var configuration = BuildConfiguration();

            var builder = new DbContextOptionsBuilder <MyProjectMigrationsDbContext>()
                          .UseSqlServer(configuration.GetConnectionString("Default"));

            return(new MyProjectMigrationsDbContext(builder.Options));
        }
コード例 #2
0
 public override void PreConfigureServices(ServiceConfigurationContext context)
 {
     MyProjectEfCoreEntityExtensionMappings.Configure();
 }