Summary
Delegates are essential tools in the .NET developer’s toolbox. Having a solid understanding of this concept will take you a long way in designing rich and extensible APIs. We’ve illustrated this using .NET Framework libraries such as LINQ, which provides for an incredibly general-purpose and extensible query capability, which was largely made possible thanks to the power of delegates.
Although the concept of functional programming lies, at least conceptually, at the heart of delegates, they can simply be seen as a strongly typed contract describing a single operation. One party acts as a consumer, invoking the delegate to reach out to the functionality provided from the outside. The other party hands out a piece of code that adheres ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access