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

            LanguageOmgDbContextConfigurer.Configure(builder, configuration.GetConnectionString(LanguageOmgConsts.ConnectionStringName));

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