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

            ClothingShopeDbContextConfigurer.Configure(builder, configuration.GetConnectionString(ClothingShopeConsts.ConnectionStringName));

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