public API_USERDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <API_USERDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            API_USERDbContextConfigurer.Configure(builder, configuration.GetConnectionString(API_USERConsts.ConnectionStringName));

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