In this presentation, Cameron Presley shows you how to implement basic LINQ Operations leveraging Funcs, Generics, and Extension Methods. Once fundamentals are in place, Cameron starts building the various LINQ methods
9. @pcameronpresley
“Set of operations that works on data
independent of the source
In addition, these operations are type safe,
allowing the compiler to catch your
mistakes sooner
9
25. @pcameronpresley
Background
◦ Introduced in C# 3.0
◦ Extends functionality to types without
having to recompile or creating a new
type
◦ Great for when working with types you
don’t have access to
25
28. @pcameronpresley
“The most common extension methods
are the LINQ standard query operators
that add query functionality to the
existing System.Collections.IEnumerable
and
System.Collections.Generic.IEnumerable
<T> types.
28
MS Docs on Extension Methods
48. @pcameronpresley
Background
Returns a subset of a collection based on a
predicate
Length is between 0 and original length
Doesn’t return items that weren’t in the
list
Maintains order
48
68. @pcameronpresley
“Use Reduce to Transform a
Collection to a Single Value by
First Identifying the Initial
Value, Followed by Writing
the Combining Logic
68