问题
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:
- 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.
- 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