how to use orderby list in c#

Mayank
Mayank
Member
78 Points
24 Posts

I want orderby descending in list<> object. I am using as

var newList = list.OrderBy(x => x.Product.Name).toList();

Thanks in advance.

Views: 8178
Total Answered: 1
Total Marked As Answer: 0
Posted On: 04-Mar-2016 00:20

Share:   fb twitter linkedin
Answers
Rahul Maurya
Rahul M...
Moderator
1170 Points
210 Posts
     

Use OrderByDescending as:

var newList = list.OrderByDescending(x => x.Product.Name).toList();
Posted On: 04-Mar-2016 08:40
banner

Blog

Active User (2)

 Log In to Chat