.OrderBy(y => y.Year).ThenBy(m => m.Month);
Come impostare descending
ordine?LINQ ordine decrescente multipla
EDIT:
ho provato questo:
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)
;
e sembra funzionare. È sbagliato usare lo orderby
due volte come l'ho usato qui?
fantastico, grazie :) Ho modificato la mia domanda, potresti per favore dare un'occhiata –