Create One-To-One relationship between table and view in EF4?

会有一股神秘感。 提交于 2019-12-23 01:17:52

问题


I have a table Item (ItemId int PK, Title vc, Description vc)

I created a testing view called ItemView: SELECT * FROM Item.

I added this view to my model, removed all the keys but the real key, added a 1-1 association, and mapped it, but I get 2 errors:

  1. The table/view 'dbo.ItemView' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view.
  2. Error 3021: Problem in mapping fragments starting at line xxxx: Each of the following columns in table Item is mapped to multiple conceptual side properties: Item.ItemId is mapped to What can be the problem?

回答1:


Edmx Views Processor - a hotfix for this issue.



来源:https://stackoverflow.com/questions/3581034/create-one-to-one-relationship-between-table-and-view-in-ef4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!