-
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
Migrations: Exception thrown with model containing TPH in certain cases: The entity type should derive from to reflect the hierarchy of the corresponding CLR types. #8423
Comments
@stitch84 Can you post a project or complete code listing that reproduces what you are seeing? Specifically, what your entity types look like, including inheritance, and the code you have in OnModelCreating? |
@ajcvickers Please see my first comment. At the end there is a link to my WebAPIApplication project. |
I tested the model in the sample project provided in OP. It throws exception as above in 1.1.1 packages. But it works correctly in preview1 bits. Sidenote: You are mixing 1.0.x & 1.1.x packages of ASP.NET core in same project. You should align them. |
@smitpatel Sorry for my stupid question, but I didn't get your point. |
@stitch84 - Yes. The next public release of EF Core with version |
@smitpatel Thank you!!! |
@divega - to update title. |
I removed many-to-many part, since it was not specific to many-to-many table. In this case, it just provided a way to discover types in certain order. |
@smitpatel thanks! |
Describe what is not working as expected.
When I try to add a migration via dotnet ef add migrations I get an exception:
I also have a many-to-many relationship in my model which is configured in
OnModelCreating
I figured out that the migration gets created when I remove the code for the many-to-many relationship in OnModelCreating and when I remove the properties for the Join Table class.
My Test project is attached.
Steps to reproduce
Further technical details
EF Core version: 1.1.1
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system: Windows 10
IDE: Visual Studio Code
WebAPIApplication.zip
The text was updated successfully, but these errors were encountered: