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

            JsonIssueDbContextConfigurer.Configure(builder, configuration.GetConnectionString(JsonIssueConsts.ConnectionStringName));

            return(new JsonIssueDbContext(builder.Options));
        }
 public override void PreInitialize()
 {
     if (!SkipDbContextRegistration)
     {
         Configuration.Modules.AbpEfCore().AddDbContext <JsonIssueDbContext>(options =>
         {
             if (options.ExistingConnection != null)
             {
                 JsonIssueDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection);
             }
             else
             {
                 JsonIssueDbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString);
             }
         });
     }
 }