views:

359

answers:

2

I have to use a View with the EF but, when e import it, the primary key of the view is displayed incorrectly and for some reason I can't change it.

A: 

Appears to be a known issue - see this other StackOverflow question and its answers:

http://stackoverflow.com/questions/1013333/entity-framework-and-sql-server-view-question

Marc

marc_s
A: 

In my experience the entity keys on a View are defined using the primary keys of the view (from the select clause). If you have multiple tables in the view you must select the primary key not the foreign key to see it as an entity key.

Davide

Davide Icardi