Today we will go through the sets operators.As all LINQ operators returns I enumerable interface and methods are designed to allow you to query data which suppoerts the Ienumerable. LINQ operators are allows to use set of operations on result of LINQ Query. There are mainly four sets opeators.
1) Distinct
2) Except
3) Union
4) Intersect
1) Distinct:
Distinct allows you to get distinct [...]
LINQ Operators - Partitioning Operators
we will go through the partitioning operators. There are mainly take and skip operators which are mainly used. Also TakeWhile and skipWhile you can use with criteria. This operators are mainly used when you want page result set. As an example if you are doing custom paging with data grid and [...]
Ordering Operator:
As the name implies that ordering operator are used to order the sequence of elements in collection object. There are four ordering operator.
1) Orderby
2) ThenBy
3) OrderbyDescending
4) ThenbyDescending
we will go through this operators using an example of employee. Here i have taken generic list of employee.
Private static List<Employee> lstEmployee = new List<Employee>()
{
new Employee() [...]
Aggregate Operator:
Aggregate operator peroform operation with two operands and result will be performed by sequential elements. Aggregate operator is extension of sum() method. Only difference is that this operator wok with - , / and *.
let’s take simple example of aggregate operator.
Int[] i = {2,8,4};
now if you make i.sum() result will be [...]