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

            AbpKendoDemoDbContextConfigurer.Configure(builder, configuration.GetConnectionString(AbpKendoDemoConsts.ConnectionStringName));

            return(new AbpKendoDemoDbContext(builder.Options));
        }
示例#2
0
 public override void PreInitialize()
 {
     if (!SkipDbContextRegistration)
     {
         Configuration.Modules.AbpEfCore().AddDbContext <AbpKendoDemoDbContext>(options =>
         {
             if (options.ExistingConnection != null)
             {
                 AbpKendoDemoDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection);
             }
             else
             {
                 AbpKendoDemoDbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString);
             }
         });
     }
 }