Linqbuilder Query with an OrderBy

Posted by Renshai on Stack Overflow See other posts from Stack Overflow or by Renshai
Published on 2010-03-12T18:47:54Z Indexed on 2010/03/12 19:07 UTC
Read the original article Hit count: 158

Filed under:
|
|

I have a 1 : M relationship.

I built a dynamic query based on input from users to return the listing of parents entities along with their children (using predicate builder:

(done successfully new TDataContext().Ps.Where(predicate) )...

but need to order the results by a field found only on the child entities.

I'm at a loss: new TDataContext().Ps.Where(predicate).OrderBy(p => p.Cs. ??)

where Ps = parents collection relationship with Cs = child entities

any help appreciated.

© Stack Overflow or respective owner

Related posts about c#

Related posts about linq-to-sql