LINQ : Distinct and Orderby
问题 I am trying to use LINQ (to EF) to get a DISTINCT list and then sort it. All the examples I found sort the result based on the DISTINCT value. But I want to sort it on a different field. Example: Table with 2 fields (canvasSize and canvasLength); var sizes = (from s in ent.competitors select s.canvasSize).Distinct().OrderBy(x => x); All the examples I found give this type of answer. But it sorts by canvasSize whereas, I want to sort by canvasLength. I'm stuck ... Any tips are greatly