コード例 #1
0
        public InfoMuridDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <InfoMuridDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            InfoMuridDbContextConfigurer.Configure(builder, configuration.GetConnectionString(InfoMuridConsts.ConnectionStringName));

            return(new InfoMuridDbContext(builder.Options));
        }
コード例 #2
0
 public override void PreInitialize()
 {
     if (!SkipDbContextRegistration)
     {
         Configuration.Modules.AbpEfCore().AddDbContext <InfoMuridDbContext>(options =>
         {
             if (options.ExistingConnection != null)
             {
                 InfoMuridDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection);
             }
             else
             {
                 InfoMuridDbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString);
             }
         });
     }
 }