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