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

            E_TicketerDbContextConfigurer.Configure(builder, configuration.GetConnectionString(E_TicketerConsts.ConnectionStringName));

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