Entity Framework CTP5 Code-First: How do I specify the type of the discrimimator column in Table-Per-Hierarchy Mapping?
问题 This blog post of the ADO.NET team shows in an example how to define Table-Per-Hierarchy Mapping in the Fluent API of Entity Framework Code-First. This is the (slightly simplified) example: public class Product { public int ProductId { get; set; } public string Name { get; set; } // more properties } public class DiscontinuedProduct : Product { public DateTime DiscontinuedDate { get; set; } } ... and the TPH mapping: modelBuilder.Entity<Product>() .Map<Product>(m => m.Requires("Type")