Page 1 of 1

Issue Listing items in Views

Posted: Mon 04 Apr 2016 15:55
by figueiredorj
Hi,

I have added a view into my model.
When I do this it seems that it kind a infers which properties shoudl be used as primary key.

First question: How does it infer which property(ies) should be key?

Also I have the following issue:
On my view, if I run it on sql or the generated query on sql it is all ok. However if I try to query it througth EF then it displays the right number of results without changing property values based on infered key.

Do you have any clue on how to solve it?
Thanks

Re: Issue Listing items in Views

Posted: Wed 06 Apr 2016 12:06
by Shalex
figueiredorj wrote:First question: How does it infer which property(ies) should be key?
There are the following rules in Entity Developer of creating EntityKey basing on the availability 1-3 in the table/view:
1. primary key
2. unique index
3. non-nullable columns
If a table/view includes nothing from the listed options, EntityKey is not created.
figueiredorj wrote:On my view, if I run it on sql or the generated query on sql it is all ok. However if I try to query it througth EF then it displays the right number of results without changing property values based on infered key.
Could you please send us a small test project with the corresponding DDL/DML script? Also specify the steps we should follow for reproducing, actual behaviour, desired behaviour.