News has a relationship with Photos, witch is 1 to many relation.
I'm trying to perform a query using linq, witch will bring a news form the db, and only the photos associated with the news, that are in a specific workflow state, for instance "published"
jsalitre
Member
18 Points
14 Posts
Complex Linq Query
Dec 29, 2012 07:00 PM|LINK
Hi, i have two entities "News" and "Photos"
News has a relationship with Photos, witch is 1 to many relation.
I'm trying to perform a query using linq, witch will bring a news form the db, and only the photos associated with the news, that are in a specific workflow state, for instance "published"
Here how i'm trying to do it:
return Context.News.Single(c => c.Id == Id).Photos.Where(p => p.WorkflowsId == 2);
can anyone explain to me how perform complex queries ?
CPrakash82
All-Star
18270 Points
2839 Posts
Re: Complex Linq Query
Dec 29, 2012 08:02 PM|LINK
Refer LINQ 101