LINQ Skip Query Operator

By Peter Bromberg

The Skip operator skips a given number of elements from a sequence and then yields the remainder of the sequence.

IQueryable<Product> lessExpensiveQuery =
    (from prod in db.Products
    orderby prod.UnitPrice descending
    select prod)
    .Skip(10);

foreach (Product prodObj in lessExpensiveQuery)
{
   Console.WriteLine(prodObj.ProductName);
}

LINQ Skip Query Operator  (597 Views)