| ||An Introduction to LINQ - slide 3 : 11|
Map, filter, and reduce
Classical wisdom from functional programming on lists:
A large set of problems can be solved by mapping, filtering, and reduction.
- Apply a function to each element of a collection and return the resulting collection
- LINQ: Select
- Apply a predicate on each element of a collection, and return those elements that satisfy the predicate
- LINQ: Where
- Apply a binary function on neighbour pairs of collection elements (either from
left to right, or right to left), and "boil" down the collection to a single value.
- LINQ: Aggregate
- Specialized aggregations: Count, Min, Max, Sum, Average.