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

            IConfigurationRoot configuration = BuildConfiguration();

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

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