OrderBy descending in Lambda expression?

Viewed 339258

I know in normal Linq grammar, orderby xxx descending is very easy, but how do I do this in Lambda expression?

6 Answers

LastOrDefault() is usually not working but with the Tolist() it will work. There is no need to use OrderByDescending use Tolist() like this.

GroupBy(p => p.Nws_ID).ToList().LastOrDefault();
Related