When I'm writing code, I'm starting to identify those places where I could use Linq. My problem is that I'm still very new to the syntax. I learn best through examples, but I can't seem to easily find the example I need.
I wanted to start this thread to create a repository of common Linq expressions that others could stumble upon via google.
The question: can you provide any examples of Linq expressions you use for common tasks?
For example, I've already written the following:
- searching a list
- summing an array
- summing a certain property in a collection of elements
To get the thread started, I'll post an answer that contains these.