I want to include a view I've generated in my database into my entity model. However, a warning message notifies me that the TABLE OR VIEW I'm attempting to create doesn't have a primary key when I try to change the entity model with VS 2008.
It seems that a key field is necessary for adding a view to the model. If views aren't allowed to include key fields, at least in Firebird, the DBMRS I'm using, how can I add this view to my model?
Any suggestions for resolving this?
The PK for views is derived by EF by merging all non-nullable fields. You can force EF to choose the PK you want by manipulating the nullability of view columns using ISNULL and NULLIF.