entity framework data not bringing back expected records.
-
Thursday, May 03, 2012 5:43 PM
So I have a view (i.e. select distinct mydata, id from mytable)
And the domainservice function with Iqueryable
EntityQuery<vwAppSystem> qry1 = prdAppDS.GetAppSystemsQuery().Where(p => p.EqId == eqa.EqId); //EntityQuery<vwAppSystem> qry1 = prdAppDS.GetAppSystemsQuery().OrderBy(p=> p.EqId); LoadOperation LoadOp = prdAppDS.Load(qry1) ; LoadOp.Completed += (s, e2) => { foreach (vwAppSystem vas in LoadOp.Entities) { xcAppSystem.Add(new AppData { String = vas.ApplicationSystem }); } };
and I am getting back records that are not distinct.
Any ideas why?
All Replies
-
Friday, May 04, 2012 3:57 PM
because it's not one-to-one. It looks to me like you're querying from the table not the view.
-
Tuesday, July 10, 2012 12:05 AM
Actually it was because I needed to set the keys in the view I was using on the entity.
This setting of keys fixed the issue.

