I\'m trying to set up my dbContext so that it can handle multiple schemas in a single Oracle database. I didn\'t want one monolithic dbContext file so I\'ve come up with the
Try using partial classes instead
public partial class oraDbContext : DbContext
{
static oraDbContext() {
Database.SetInitializer(null);
}
public oraDbContext(string connName)
: base("Name=" + connName) { }
protected override void OnModelCreating(DbModelBuilder modelBuilder) {
schema1(modelBuilder);
schema2(modelBuilder);
}
}
public partial class oraDbContext : DbContext
{
public DbSet someTable { get; set; }
void schema1(DbModelBuilder modelBuilder)
{
modelBuilder.Configurations.Add(new someTableMap());
}
}