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