I don't believe that Distinct() is guaranteed to maintain the order of the set.
Try pulling out an anonymous type first and distinct/sort on that before you convert to string:
var ud = env.Select(d => new
{
d.ReportDate.Year,
d.ReportDate.Month,
FormattedDate = d.ReportDate.ToString("yyyy-MMM")
})
.Distinct()
.OrderByDescending(d => d.Year)
.ThenByDescending(d => d.Month)
.Select(d => d.FormattedDate);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…