Wednesday, 21 August 2013

Find MAX/MIN list item using LINQ?

Find MAX/MIN list item using LINQ?

I have a list Having multiple Items and 3 props ID,DATE,COMMENT.ID field
is Auto incremented in DATABASE.
Let say list Contains
2,16AUG,CommentMODIFIED
1,15AUG,CommentFIRST
3,18AUG,CommentLASTModified
I want to get a single ITEM.Item Having Minimum DATE and having Latest
Comment. In this case
1,15AUG,CommentLASTModified
Any easy way to do it using LINQ.

No comments:

Post a Comment