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