Issue Listing items in Views

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
figueiredorj
Posts: 36
Joined: Fri 12 Apr 2013 19:05

Issue Listing items in Views

Post by figueiredorj » Mon 04 Apr 2016 15:55

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

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Re: Issue Listing items in Views

Post by Shalex » Wed 06 Apr 2016 12:06

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.

Post Reply