Entity Framework 7 -The entity type 'object' requires a key to be defined

entity-framework entity-framework-core

Question

I am getting this error when migrating in EF 7

Microsoft.Data.Entity.Metadata.ModelItemNotFoundException: The entity type 'object' requires a key to be defined.

I am not sure what I am doing wrong. This is the dependencies I am using on project.json

  • "EntityFramework.SqlServer": "7.0.0-beta5",
  • "EntityFramework.Commands": "7.0.0-beta5"
1
2
11/2/2015 5:18:58 AM

Popular Answer

Most likely you're using some Data annotations that are not yet supported so you will need to use the Fluent API for configuration.

https://github.com/aspnet/EntityFramework/issues/1913

Using [ComplexType] in Entity Framework Core

3
5/23/2017 10:28:31 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow