public DbContext ReloadDbContext() { var migrationsAssembly = DbContextBuilder.BuildDbContextAssembly(DatasetName); this.DbContext = DbContextBuilder.GetDBContext(migrationsAssembly, $"Models.Contexts.{DatasetName}.Context", ob => ob.UseNpgsql(ConnectionString, o => o.MigrationsAssembly(migrationsAssembly.GetName().ToString()))); return(DbContext); }
public DatabaseCreator(string connectionString, string datasetName, Assembly asm = null) { this.ConnectionString = connectionString; this.DatasetName = datasetName; var dbContextAssembly = asm ?? DbContextBuilder.BuildDbContextAssembly(DatasetName); this.DbContext = DbContextBuilder.GetDBContext(dbContextAssembly, $"Models.Contexts.{DatasetName}.Context", ob => ob.UseNpgsql(ConnectionString)); }