SORU
13 EKİM 2010, ÇARŞAMBA


C# liste.Orderby azalan

Bu sonuç, ama azalan dönüş yapmak istiyorum. Bu mümkün mü?

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

Yukarıdaki gibi, ama ters.

CEVAP
13 EKİM 2010, ÇARŞAMBA


Emin:

var newList = list.OrderByDescending(x => x.Product.Name).ToList();

Doktor: OrderByDescending(IEnumerable, Func).

Yorum yanıt:

var newList = list.OrderByDescending(x => x.Product.Name)
                  .ThenBy(x => x.Product.Price)
                  .ToList();

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Blue Lightning TV

    Blue Lightni

    9 EKİM 2011
  • ibebrent

    ibebrent

    23 Temmuz 2007
  • My Name Is Jeff

    My Name Is J

    26 ŞUBAT 2008