Delegates, Lambda Expressions & Closures in C#

If you are familiar with programming, you might have heard of a specific paradigm called functional programming. Most modern languages, such as Java and C#, have integrated some functional elements over time. Other, like Scala and Haskell, were built around that very idea of functional programming.

This online course will look at some of the functional features available in C# 3.0, including the concept of anonymous functions, delegates and lambda expressions. But before doing that, we need to understand what functional programming actually means.

If you are interested, keep reading, and we will explore the following topics:

  • Anonymous functions
  • Delegates
  • Anonymous delegates
  • Multicast delegates
  • Lambda expressions
  • Lambda statements
  • Expression-body members
  • Expression trees
  • Local functions
  • Closures
Continue reading