LINQ 심층 분석 : 쿼리 연산자의 입력과 출력

RTFM/C# 2009. 3. 26. 13:47

http://aspnet.4guysfromrolla.com/articles/032509-1.aspx

 

LINQ의 표준 쿼리 연산자에 대해 깊이 있게 파헤쳐 봅니다.

마지막의 두 단원 (Chaining Query Operators / Query Operators and Deffered Execution)이 특히 유용한데, 예를 들어

// C# - Create an instance of the Fibonacci class to hold the first 7 numbers
Fibonacci fib = new Fibonacci(7);
// Compute the sum of those elements in fib whose preceding elements' sum is greater than or equal to 6
int oddSum = fib.SkipUntilSummationSurpassed(6).Where(x => x % 2 == 1).Summation();

에서, 세 개의 쿼리 연산자의 실행 순서와 그 내부 동작을 설명한 부분과,

욕심쟁이 쿼리 연산자(greedy query operator)와 게으른 쿼리 연산자(lazy query operator)에 대한 설명은 꼭 한번 읽어보실 것을 추천합니다.

: