Partitioning Operators

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 ...

Get Visual Basic 2015 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.