Cannot add a view to EDMX

242 views
Skip to first unread message

Mark OMeara

unread,
Jan 28, 2015, 7:55:42 PM1/28/15
to npgsq...@googlegroups.com
Hello

It seems I cannot add a view to the edmx designer using EntityFramework. As a test I created a simple view of one table that has a NOT NULL bigint serial as a key.
The error in the edmx designer is:

Warning 1 Error 6013: The table/view '<view name>t' does not have a primary key defined and no valid primary key could be inferred. This table/view has been excluded. To use the entity, you will need to review your schema, add the correct keys, and uncomment it.

Clearly it cannot determine a key from the view even though it is directly based on a table with a key very clearly defined. Is there any way around this issue without having to manually edit the edmx?


Thanks
Mark


Mark OMeara

unread,
Feb 25, 2015, 3:52:28 PM2/25/15
to npgsq...@googlegroups.com
For anyone who has the same issue - I fixed it by abandoning the edmx and going code first.
Reply all
Reply to author
Forward
0 new messages