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

            TrafficManagementBusinessCoreDbContextConfigurer.Configure(builder, configuration.GetConnectionString(TrafficManagementBusinessCoreConsts.ConnectionStringName));

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