boutique replica bags up ideas

the best replique rolex and prices here.

julia highlight 99j hair color 10a quality straight human hair lace front wigs 8 - 24 inches pre plucked hairline 13x4 inches lace front brazilian wig onlinefor sale

C# LINQ Partitioning Operators – Take and Skip

Updated on     Kisan Patel

The Partitioning operators in LINQ are used to divide an enumerable sequence into two sections and returning the result set without rearranging the elements with one of the sections that satisfies the condition.

The Take, Skip, TakeWhile and SkipWhile are the Partitioning operators.

The Partitioning operators are useful to navigating easily in the application through your query.

The Take Clause

The Take clause returns the specified number of elements from the input sequence, from the beginning of the sequence.

For Example,

NorthwindEntities _db = new NorthwindEntities();

var customers = _db.Customers.Take(5);

foreach (var customer in customers)
{
        Console.WriteLine(customer.CompanyName + " - " + customer.Country);
}

the output of the above C# program…

linq-take-operator

The Skip Clause

The Skip clause skips the specified number of elements from the input sequence starting from the beginning of the input sequence, and returns the rest of the sequence.

Note: When using Skip clause in query you must use OrderBy method before the method Skip.

For Example,

NorthwindEntities _db = new NorthwindEntities();

var customers = _db.Customers.OrderBy(x => x.Country).Skip(4);

foreach (var customer in customers)
{
        Console.WriteLine(customer.CompanyName + " - " + customer.Country);
}

the output of the above C# program…

linq-skip-operator


C# LINQ

Leave a Reply