Creating a navigation / association from a table for viewing in EF 4.0

I have a container table with ContainerId as PK (int) and view (readonly) vwBlobRef with a BlobRefId column defined as PK and ContainerId as FK. By the way, I need to manually set BlobRefId as the entity key for the view ...

Now I want to create an association to get the navigation properties from the table to the view (on the contrary, this is not so important). Therefore, I add a one-to-many association and uncheck the "Add foreign key to vwBlobRef" checkbox

Now I get:

Error 3027: No mapping is defined for the next EntitySet / AssociationSet - ContainervwBlobRef.

I do not know how to build this mapping. I can right-click on the association line and select either a table or a view. But I don’t understand which one to choose and what to choose in the column names.

+4
source share
1 answer

Try using a reference restriction . In your case, you are trying to define an association that does not use your FK and requires matching. But since such a relationship does not exist in the database, you have nothing to display.

+3
source

Source: https://habr.com/ru/post/1396220/


All Articles