How can I map table splitting with EF Code First? Table splitting for EDMX is described for example here. It allows mapping two entities with 1:1 relation into same table. I
Here is how I just got EF 4.1 (RC) to do table splitting in Code First.
In your OnModelCreating override . . . a. Map both entities to the same table. b. Create the relationship between the two tables.
modelBuilder.Entity<EntityOne>().ToTable("MySingleTable");
modelBuilder.Entity<EntityTwo>().ToTable("MySingleTable");
modelBuilder.Entity<EntityOne>().HasRequired(p => p.NavToEntityTwo).WithRequiredDependent(c => c.NavToEntityOne);
This is working for me, but realize that given the newness of the RC I've only been able to look at limited and simple scenarios.