.OrderBy(y => y.Year).ThenBy(m => m.Month);
Cómo configurar descending
orden?orden múltiplo linq DESCENDENTE
EDITAR:
yo probamos este:
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)
;
y parece trabajar. ¿Es incorrecto usar orderby
dos veces como lo usé aquí?
genial, gracias :) Edité mi pregunta, ¿podría echar un vistazo? –