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