LINQ / C#

LINQ Query Operators

LINQ provides more than 50 query operators for different functionalities. Every query operator is an extension method. These operators can be categorized into following one: Operator Category LINQ Query Operators Names Filtering Where, OfType Sorting OrderBy, OrderByDescending, ThenBy, ThenByDescending Set Except, Intersect, Union, Distinct Quantifier All, Any, Contains Projection Select, …

LINQ Query Operators Read More
LINQ / C#

LINQ Where Filtering Operator

LINQ where operator comes in Filtering operators category. Here is a list of all LINQ Operators. Where operator filter the list based on some given criteria. Where operator is an extension method which accept a Func delegate as a parameter. Func accept only a single argument element. An element is passed …

LINQ Where Filtering Operator Read More
LINQ / C#

LINQ OfType Filtering Operator

OfType comes in Filtering operator category. Here is list of all Query Operators. LINQ OfType operator filter the objects from a collection based on Types. In a collection, we have multiple elements of different Types and we have to select only those objects from the collection that are of specific Type. C# Example of OfType …

LINQ OfType Filtering Operator Read More
LINQ / C#

LINQ OrderBy Operator

LINQ OrderBy operator comes first in LINQ Sorting Operators. OrderBy operator sort the sequence (collection) based on particular property in ascending order. We can use OrderBy operator both in Query Syntax and Method Syntax. Below is the syntax of OrderBy operator. As shown in the above syntax, this operator take …

LINQ OrderBy Operator Read More
LINQ / C#

LINQ ThenBy Operator

LINQ ThenBy Operator is used when we want to sort the elements in a collection by using multiple properties in ascending order. This operator must use after OrderBy or OrderByDescending operator. First OrderBy operator sort the collection based on a single property and then we can use ThenBy operator to …

LINQ ThenBy Operator Read More
LINQ / C#

LINQ OrderByDescending Operator

LINQ OrderByDescending operator sort the elements in a sequence in descending order. You can find LINQ sorting operators list here. Below is the syntax of OrderByDescending operator. As shown in above syntax, OrderByDescending is an extension method which takes a single element and return property name on which we want …

LINQ OrderByDescending Operator Read More
LINQ / C#

LINQ Except Operator

LINQ Except operator comes under Set operators category in LINQ. LINQ Set operators is used for compare two sequences (collections) and find common, missing and unique elements. You can find entire list of set operators here. Except operator compares two sequences (collections) classes and find those elements which are not present in second …

LINQ Except Operator Read More
LINQ / C#

LINQ Union Operator

LINQ Union operator is used for finding unique elements between two sequences (Collections). For example, suppose we have two collections A = { 1, 2, 3 }, and B = { 3, 4, 5 }. Union operator will find unique elements in both sequences. { 3 } element is available …

LINQ Union Operator Read More