Пример #1
0
        public DLQDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <DLQDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            DLQDbContextConfigurer.Configure(builder, configuration.GetConnectionString(DLQConsts.ConnectionStringName));

            return(new DLQDbContext(builder.Options));
        }
Пример #2
0
 public override void PreInitialize()
 {
     if (!SkipDbContextRegistration)
     {
         Configuration.Modules.AbpEfCore().AddDbContext <DLQDbContext>(options =>
         {
             if (options.ExistingConnection != null)
             {
                 DLQDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection);
             }
             else
             {
                 DLQDbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString);
             }
         });
     }
 }