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