ModelBuilder: Exception when KeyAttribute used with inheritance #5898
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
type-bug
Milestone
Steps to reproduce
In my model there are transactions of following types:
Base class looks like this:
and these are descendants:
In ApplicationDbContext is the following:
The issue
When trying to create initial migration I get the following:
The exception is only thrown for BoxOfficeSaleTransaction and BoxOfficeRefundTransaction. When I remove these from the model (only BoxOfficeStatusChangeTransaction remains) then migration is generated.
When I comment out the Key data annotation for Id property in BoxOfficeTransaction and use following fluent configuration, migration is generated without error.
Further technical details
EF Core version: 1.0.0 (RTM)
Operating system: Windows 10
Visual Studio version: VS 2015 Update 3
I can provide full model by private channel.
The text was updated successfully, but these errors were encountered: