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

            LinXiDecorateDbContextConfigurer.Configure(builder, configuration.GetConnectionString(LinXiDecorateConsts.ConnectionStringName));

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