public DoAspnetboilerplateLdapDbContext CreateDbContext(string[] args) { var builder = new DbContextOptionsBuilder <DoAspnetboilerplateLdapDbContext>(); var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder()); DoAspnetboilerplateLdapDbContextConfigurer.Configure(builder, configuration.GetConnectionString(DoAspnetboilerplateLdapConsts.ConnectionStringName)); return(new DoAspnetboilerplateLdapDbContext(builder.Options)); }
public override void PreInitialize() { if (!SkipDbContextRegistration) { Configuration.Modules.AbpEfCore().AddDbContext <DoAspnetboilerplateLdapDbContext>(options => { if (options.ExistingConnection != null) { DoAspnetboilerplateLdapDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection); } else { DoAspnetboilerplateLdapDbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString); } }); } }