I work on a legacy database that stores Users in one of two tables (ActiveUsers, InactiveUsers). In my DbContext I defined the following DbSets to work with the two Usertables:
public DbSet<User> ActiveUsers{ get; set; }
public DbSet<User> InactiveUsers{ get; set; }
How can I map the User entity to the tables? I’m stuck with these Mappings:
// OK
modelBuilder.Entity<User>().ToTable("ActiveUsers");
// Overwrites the mapping above :(
modelBuilder.Entity<User>().ToTable("InactiveUsers");
I think I need to configure the DbSets somehow…
PS: This MSDN article seems to solve my problem for “classic” EF with an EDMX.
As Pawel pointed out: