I'm trying to retrieve the VideoCollection items from 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?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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.