I'm ordering a number of objects by their System.DayOfWeek
property.
DayOfWeek treats Sunday as the start of the week, whereas I would like it to be ordered so it appears at the end. It's just an enum, so I can't modify it. However I've read that I may be able to create a custom culture but think this is probably overkill.
List<TimeBand> orderedTimeBands = timeBands.OrderBy(x => x.DayName).ToList()
So DayName
is a DayOfWeek
, i want orderedTimeBands
to be ordered from Monday -> Sunday.
Any ideas?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…