Currently, if I want to use Fluent API to stipulate the table-per-type inheritance strategy, I have to do the following:
modelBuilder.Entity<User>().ToTable("User");
modelBuilder.Entity<ContentItem>().ToTable("ContentItem");
modelBuilder.Entity<MarketItem>().ToTable("MarketItem");
If I somehow forget to add a command for a new inherited entity it will break my schema.
What I would like to do, in pseudo code, is:
foreach (ModelType T in AllModelTypes)
{
modelBuilder.Entity<T>().Table(T.ToString());
}
Is there anything built-in to EF Fluent API that accomplishes this?
If not, is there a way I can achieve the foreach loop as described above (iterating over types?)