开发者

Entity Framework trying to retrieve non existent column

Entity Framework trying to retrieve non existent column

I'm trying to retrieve the VideoCollection items f开发者_如何学运维rom the database, but getting {"Invalid column name 'User_Id'."} - when I set a breakpoint I can see that the EF is trying to select User_Id column but it doesn't exist in the Cs object or the database schema. (It does exist in another table but that shouldn't matter). Is there anyway to debug why this is happening?


Do you have a User class that has a reference to a VideoCollection? If so, you probably need to explicitly define the relationship between the two. As it is, it looks like EF is inferring that the VideoCollection should contain a foreign key, User_Id that defines the relationship.


may be you have inherit your base class in another.. check it

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜