C#/Winform
(Linq) 점표기식
kjun.kr
2017. 4. 14. 12:00
728x90
var adults = from pl in pList
where pl.age >= 18
select pl;
위 구문을 아래 처럼 간단히 점 표기식으로 표현할 수 있다.
var adults = pList.Where(c => c.age >= 19);
--------------------------------------------------------
orderby item.Rating descending, iten.Price, item.Name
위 구문을 아래 처럼 점 표현식으로 표현이 가능하다.
.OrderByDescending(item=>item.Rating)
.ThenBy(item=>item.Price)
.ThenBy(item=>item.Name)
728x90