You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary version: I have two simple, related classes on which I am trying to define keys using the fluent api (I switched from using data annotations because the child class uses a composite primary key, one of whose elements is a foreign key back to the master class, and composite primary keys are not supported in EF7 via annotations).
When I run dnx ef migrations add [name], I get an error that the classes "cannot have keys other than those declared on the root type". But they are not derived types (well, they're derived from object, implicitly, but nothing else).
The text was updated successfully, but these errors were encountered:
dupe of #3727
The class Site contain property of type object. Which is being discovered as navigation because TypeMapper cannot map object to any SqlServer Type. That adds object as entity type in the model. Since all classes are implicitly derived from object, every other entity type becomes derived type of entity type representing object.
In #3737, we blocked discovering object as navigation since it causes above and the error message becomes to hard to understand what is exactly happening. It will be shipping in RC2 release.
After the fix, when you have property of type object following is the error message.
The property 'Site.Parameters' could not be mapped, because it is of type 'object' which is not a supported primitive type or a valid entity type. Either explicitly map this property, or ignore it.
I wrote this up over on stackoverflow (http://stackoverflow.com/questions/36797464/ef7-keys-on-derived-type-but-its-not) but thought I'd mention it here.
Summary version: I have two simple, related classes on which I am trying to define keys using the fluent api (I switched from using data annotations because the child class uses a composite primary key, one of whose elements is a foreign key back to the master class, and composite primary keys are not supported in EF7 via annotations).
When I run dnx ef migrations add [name], I get an error that the classes "cannot have keys other than those declared on the root type". But they are not derived types (well, they're derived from object, implicitly, but nothing else).
The text was updated successfully, but these errors were encountered: