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

            AzSMDbContextConfigurer.Configure(builder, configuration.GetConnectionString(AzSMConsts.ConnectionStringName));

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