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