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

            LpwDbContextConfigurer.Configure(builder, configuration.GetConnectionString(LpwConsts.ConnectionStringName));

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