July 2015
Intermediate to advanced
1300 pages
87h 27m
English
Partitioning operators enable you to use a technique known as paging, which is common in data access scenarios. There are two main operators in LINQ: Skip and Take. Skip avoids selecting the specified number of elements, and Take puts the specified number of elements into a sequence. The code in Listing 23.3 shows an example of paging implementation using the two operators.
LISTING 23.3 Implementing a Basic Paging Technique
Module Partitioning Private pageCount As Integer Private Products As List(Of Product) Sub PopulateProducts() Dim prod1 As New Product With {.ProductID = 0, .ProductName = "Pasta", .UnitPrice ...