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

            BookingSystemDbContextConfigurer.Configure(builder, configuration.GetConnectionString(BookingSystemConsts.ConnectionStringName));

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