public ResearchDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <ResearchDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder(), addUserSecrets: true);

            ResearchDbContextConfigurer.Configure(builder, configuration.GetConnectionString(ResearchConsts.ConnectionStringName));

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