I have the following that I’d like to sort:
IQueryable<Map> list;
list = from item in ctx.MAP
.Include("C")
.Include("L")
.Include("L.DP")
select item;
return list.OrderBy(m=>(m.L.DP.Name + m.L.Code));
This works, but it sorts alphabetically – so 12 comes before 9. (Assume Code is a numeric field)
What is the best way to sort this so Code is sorted numerically?
You probably want to use the ThenBy extension method to be able to sort by multiple fields 😉
In your case that would be