Hey, I want to make this return the result, but in descending order. Is that possible?
var newList = list.OrderBy(x => x.Product.Name).toList();
I thought I could just add descending, like I do in other cases, but it is not accepting that.
Hey, I want to make this return the result, but in descending order. Is that possible?
var newList = list.OrderBy(x => x.Product.Name).toList();
I thought I could just add descending, like I do in other cases, but it is not accepting that.
Sure:
var newList = list.OrderByDescending(x => x.Product.Name).ToList();
In response to your comment:
var newList = list.OrderByDescending(x => x.Product.Name)
.ThenBy(x => x.Product.Price)
.ToList();