Meskipun C dibuat untuk memprogram sistem dan jaringan komputer namun bahasa ini juga sering digunakan dalam mengembangkan software aplikasi. C juga banyak dipakai oleh berbagai jenis platform sistem operasi dan arsitektur komputer, bahkan terdapat beberepa compiler yang sangat populer telah tersedia.
C adalah huruf ketiga dalam alfabet Latin. Dalam bahasa Indonesia, huruf ini disebut ce (dibaca [tʃe]).
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.
var newList = list.OrderBy(x => x.Product.Name).Reverse()
This should do the job.
look it this piece of code from my project
I'm trying to re-order the list based on a property inside my model,
allEmployees = new List<Employee>(allEmployees.OrderByDescending(employee => employee.Name));
but I faced a problem when a small and capital letters exist
, so to solve it, I used the string comparer.
allEmployees.OrderBy(employee => employee.Name,StringComparer.CurrentCultureIgnoreCase)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With