database view ignored in entity data model
Posted: Fri 11 Feb 2011 07:29
Hi
when I generate an entity data model from my database all works fine except that my view is ignored. The generated .edmx file contains the following error message:
"The table/view 'xyz' 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."
My view contains a primary key of a table that can be used as primary key of the view objects. But maybe because of some outer joins and a distinct command this is not clear to the entity model generator.
How can I solve this problem? Manually editing the .edmx file is no solution because this changes always get lost if a create the model again.
when I generate an entity data model from my database all works fine except that my view is ignored. The generated .edmx file contains the following error message:
"The table/view 'xyz' 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."
My view contains a primary key of a table that can be used as primary key of the view objects. But maybe because of some outer joins and a distinct command this is not clear to the entity model generator.
How can I solve this problem? Manually editing the .edmx file is no solution because this changes always get lost if a create the model again.