How to sort items alphabetically having same priority value?

Viewed 99

We have a list of items with a priority property (1,2,3,...). We sort them via

itemList.OrderByDescending(x => x.Priority).ToList();

Here is some example input:

banana    1
apple     1
item3     2
item4     3
item5     0

There are scenario where items having same priorities(apple, banana) in this case wanted to sort same priorities items alphabetically.

item4     3
item3     2
apple     1
banana    1
item5     0
1 Answers
Related