C# list.Orderby descending
Sure:
var newList = list.OrderByDescending(x => x.Product.Name).ToList();
Doc: OrderByDescending(IEnumerable, Func).
In response to your comment:
var newList = list.OrderByDescending(x => x.Product.Name)
.ThenBy(x => x.Product.Price)
.ToList();
Yes. Use OrderByDescending
instead of OrderBy
.
list.OrderByDescending();
works for me.