Category: Articles

LINQ-Image

Aggregate Operators LINQ Part 13

LINQ Operators in ASP.NET – Aggregate Operators Original Post Aggregate operators return single values. The operators are as follows: Aggregate = Applies a function over a sequence. Average = Computes the average of a sequence of numeric vaules. Count, LongCount = Counts the number of elements in a sequence. Max = Finds the maximum of […]

LINQ-Image

Restriction Operators LINQ Part 1

LINQ Operators in ASP.NET – Restriction Operators Original Post Restriction operators would be used for instance to filter a selection of results based on a given predicate. If we have for example a list of countries and we want to filter our list out to select only the countries that begin with ‘A’ we would […]

LINQ-Image

Projection Operators LINQ Part 11

LINQ Operators in ASP.NET – Projection Operators Original Post Say we want to take an array of numbers {5,8,3,2,4,3,1} and wish to increment this list by 1 we would use a Select clause projection operator. A given output to our operator would result in an array {6,9,4,3,5,4,2}. The SelectMany clause would achieve the same task […]

LINQ-Image

Custom Sequence Operators LINQ Part 15

LINQ Operators in ASP.NET – Custom Set Operators Original Post We would use custom sequence operators to calculate the dot procedure of two integer vectors. Related Atricles Restriction Operators LINQ Part 1 Aggregate Operators LINQ Part 2 Conversion Operators LINQ Part 3 Element Operators LINQ Part 4 Generation Operators LINQ Part 5 Grouping Operators LINQ […]

LINQ-Image

Partitioning Operators LINQ Part 10

LINQ Operators in ASP.NET – Partitioning Operators Original Post At times data may need to be partitioned into two parts and then have one of those parts returned. The partition operator is all about partitioning data with LINQ. Skip = Skips a given number of elements from a sequence and then yields the remainder of […]

LINQ-Image

Join Operators LINQ Part 7

LINQ Operators in ASP.NET – Join Operators Original Post The join operator as with many other query languages matches elements into two collections based on a certain condition Join = Performs an inner join of two sequences based on matching keys extracted from the elements. GroupJoin = Performs a grouped join of two sequences based […]

LINQ-Image

Ordering Operators LINQ Part 9

LINQ Operators in ASP.NET – Ordering Operators Original Post Simply put ordering operators are used in ordering lists. OrderBy, OrderByDescending, ThenBy, ThenByDescending = Make up a family of operators that can be composed to order a sequence by multiple keys. Reverse = Reverses the elements of a sequence.

Related Atricles Restriction Operators LINQ Part […]

LINQ-Image

Grouping Operators LINQ Post 6

LINQ Operators in ASP.NET – Grouping Operators Original Post A query expression can return the results as groups. With the group by operators in the C# language, we separate the results of an expression into groups. This makes some query expressions more effective. GroupBy = Groups the element of a sequence.

Related Atricles Restriction […]

LINQ-Image

Set Operators LINQ Part 14

LINQ Operators in ASP.NET – Set Operators Original Post Set operations are query operations that produces a result set based on the presence or absence of equivalent elements within the same or separate collections. Distinct = Eliminates duplicate elements from a sequence. Except = Enumerates the first sequence, collecting all distinct elements; then enumerates the […]

LINQ-Image

Conversion Operators LINQ Part 3

LINQ Operators in ASP.NET – Conversion Operators Original Post Conversion operators are used primarily for returning different types. They can be used to return to only particular elements from a collection. AsEnumerable = Returns its argument typed as IEnumerable. Cast = Casts the elements of a sequence to a given type. OfType = Filters the […]