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