Lambdas & LINQ in C# – Bonus: Deciphering the Join Method

Previously, we looked at demystifying LINQ method syntax, including Where, OrderBy, and SingleOrDefault. The Join method looks a bit more complicated – 4 generic types and 5 parameters. But when we take a closer look, we see that we’ve already dealt with the pieces in similar methods. We’ll take a closer look to fully understand […]

Lambdas & LINQ in C# – Bonus: Captured Variables & for Loops

Lambda Expressions have a really cool feature called “captured variables”. This is very useful (as we saw in Part 1), but it can also be dangerous if we try to capture the indexer of a “for” loop. Today we’ll see the problem in action, and we’ll also look at a really easy solution. For code […]

Lambdas & LINQ in C# – Part 3: Declarative Programming with LINQ

We’re used to imperative programming in C# — this is where we tell the computer *how* to accomplish a task. With declarative programming, we tell the computer *what* we want and let it figure out the details. This can make our code much easier to read and understand. And LINQ can help us get there. […]

Lambdas & LINQ in C# – Part 2: Demystifying LINQ Methods

LINQ (Language Integrated Query) is an amazingly powerful tool. But the method signatures are confusing. Today we’ll look at the syntax of the LINQ methods, learn to decipher the parameters and return values, and also see how lambda expressions play a key role in calling these methods. Once we understand this, LINQ becomes extremely simple […]

Lambdas & LINQ in C# – Part 1: Lambda Expression Basics

Lambda Expressions are confusing when we first walk up to them. But they’re pretty easy to understand once we take a bit of a closer look. Today we’ll look at the syntax features and also captured variable. When we’re comfortable with lambda expressions, we can use them to take advantage of LINQ (Language Integrated Query) […]