-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Abstract base class unexpectedly included in TPC model resulting in InvalidOperationException (requires a key to be defined) #3525
Comments
@MatthewMWR Does this error occur if you don't use reflection to loop over all derived types of |
The ToolBase entity gets added to the model whenever DbSet Tools { get; set; } is added to the dbcontext. If I leave OnModelCreating() blank the same thing happens. |
Same with this one, if you can retry on the nightly |
Since the entity |
Yes, to have things work exactly like this you will need TPC support which is not planned for EF 7 RTM. Besides going with TPH another way you can compromise is to not include
|
@rowanmiller I think this is just a dupe of #3170. |
Combining all of the bugs together here #3526 & #3527 |
Closing out as this is the correct behavior given that inheritance will always mean TPH at the moment (and TPH will always be the default if nothing is specified in configuration). #3170 is tracking TPC support. |
To me seems unexpected, but I could have the wrong expectation.
Exception:
Repro:
The text was updated successfully, but these errors were encountered: