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

            ABPDemoDbContextConfigurer.Configure(builder, configuration.GetConnectionString(ABPDemoConsts.ConnectionStringName));

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