Hi folks,
I have some Linq code, that works fine. It retrieves a list of board posts ordered by the most recent.
The catch here is the order by ... it orders by the most recent COMMENTS. So if a board post just got a comment, then it will be up the top of the list (ie. most recent).
kewl ... but what about new board posts that just got created? They are listed down the bottom, because they have NO comments :( It's like i want to say "order by most recent comments .. but if u have no comment, then its by your board post create date)".
here's my linq...
boardPostList = (from bp in db.tblBoardPosts.Where(whereClause)
orderby (from bc in bp.tblBoardComments
orderby bc.DateModified descending
select bc.DateModified).First() descending
select bp).ToPagedList(pageNumber, numberOfResults);
Does anyone have any suggestions?