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