efcore icon indicating copy to clipboard operation
efcore copied to clipboard

EF7 Class Inheritance

Open WillBaldwin opened this issue 11 years ago • 2 comments

using EntityFramework 7.0.0.-beta1

I have class inheritance setup with the intent to implement Table per Hierarchy (TPH) database schema on SQL Server. As I understand it EF7 should default to TPH but in my test application it is defaulting to (TPC). Is there a HINT I can give EF7 to indicate TPH is my intent?

public class Book { public int BookId; public string Name; } public class Paperback : Book{} public class Notebook : Book{} public class Hardcover: Book{}

WillBaldwin avatar Jan 24 '15 17:01 WillBaldwin

I found where TPH support is a still a TODO item in the repo...

WillBaldwin avatar Jan 24 '15 20:01 WillBaldwin

Here is the work item tracking inheritance support: https://github.com/aspnet/EntityFramework/issues/247

rowanmiller avatar Jan 26 '15 17:01 rowanmiller