Help with a algorithm in linq to resolve a query

Posted by Deumber on Stack Overflow See other posts from Stack Overflow or by Deumber
Published on 2010-05-05T12:58:33Z Indexed on 2010/05/05 13:08 UTC
Read the original article Hit count: 162

Filed under:
|

I have been some time thinking how to resolve this problem, but out of ideas i prefer expose it for help.

I have 2 tables (linq to sql) A and B, A have a many relation with B, so A have a property EntitySet of B

 A have the following properties:
  CreateDate (Datetime)
  ModificateDate (Datetime)
  Bs (EntitySet<B>)

 B have the following properties:
  CreateDate (Datetime)
  ModificateDate (Datetime)

All that i want is return a ordered collection of A by the Max date between :

 A.CreateDate, 
 A.ModificateDate, 
 The Max B.CreateDate of all B in A
 The Max B.ModificateDate of all B in A

if i someone need a little example, just ask for it.

© Stack Overflow or respective owner

Related posts about LINQ

Related posts about algorithm