로딩
티스토리 데이터 처리 중입니다.

[C#/Linq] Linq절에서 ascending 및 descending

 [C#/Linq] Linq절에서 ascending 및 descending

아래는 링큐절에서 오름차순과 내림차순의 간략예제 입니다. 오름차순 : orderby 를 명명하고 ascending 사용.

가장 작은 값에서 가장 큰 값의 순으로 지정이 됩니다. IEnumerable ascendingQuery = from car in cars orderby car ascending select car; 내림차순 : orderby 를 명명하고 descending 사용 가장 큰 값에서 가장 작은 값의 순으로 지정이 됩니다.

IEnumerable descendingQuery = from car in cars orderby car descending select car;...