I have a Departments table, which has a foreign key column to Sites, on Department.SiteId = Sites.SiteId. Now in my EF model, my Departments entity doesn't have a Siteid attribute, just a reference to Sites. How do I select, in a LINQ query, all departments with a specific SiteId?
+2
A:
var query =
from d in entities.Departments
where d.Site.SiteId == theSiteId
select d;
Ben M
2009-09-19 15:17:01
So simple, yet so elusive. Thanks! I was looking all over for SitesReference.EntityKey etc.
ProfK
2009-09-19 15:21:49