Partitioning Operators

Partitioning operators allow accomplishing a technique known as paging, which is common in data access scenarios. There are two main operators in LINQ: Skip and Take, in which Skip avoids selecting the specified number of elements, and Take puts the specified number of elements into a sequence. Code in Listing 24.3 shows an example of paging implementation using the two operators.

Listing 24.3 Implementing a Basic Paging Technique



The private field pageCount acts as a counter. According to its value, the query skips the number ...

Get Visual Basic® 2010 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.