.OrderBy(y => y.Year).ThenBy(m => m.Month);
descending
ऑर्डर कैसे सेट करें?linq एकाधिक ऑर्डर DESCENDING
संपादित:
मैं इस कोशिश की:
var result = (from dn in db.DealNotes
where dn.DealID == dealID
group dn by new { month = dn.Date.Month, year = dn.Date.Year } into date
orderby date.Key.year descending
orderby date.Key.month descending
select new DealNoteDateListView {
DisplayDate = date.Key.month + "-" + date.Key.year,
Month = date.Key.month,
Year = date.Key.year,
Count = date.Count()
})
//.OrderBy(y => y.Year).ThenBy(m => m.Month)
;
और यह काम कर लगता है। क्या orderby
का उपयोग करना गलत है जैसे मैंने इसे यहां इस्तेमाल किया?
महान, धन्यवाद :) मैंने अपना प्रश्न संपादित किया, क्या आप कृपया एक नज़र डालें –