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

            EmlakTakipDbContextConfigurer.Configure(builder, configuration.GetConnectionString(EmlakTakipConsts.ConnectionStringName));

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