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

            WardrobeCloudDbContextConfigurer.Configure(builder, configuration.GetConnectionString(WardrobeCloudConsts.ConnectionStringName));

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