September 2021
Intermediate to advanced
1008 pages
31h 9m
English
Delegates are the .NET variant of addresses to methods. A delegate is an object-oriented type-safe pointer to one or multiple methods. Lambda expressions are directly related to delegates. When the parameter is a delegate type, you can use a lambda expression to implement a method that's referenced from the delegate.
This chapter explains the basics of delegates and lambda expressions, and it shows you how to implement methods called by delegates with lambda expressions. It also demonstrates how .NET uses delegates as the means of implementing events.
In Chapter 4, “Object-Oriented Programming in C#,” you read about using interfaces as contracts. If the parameter ...
Read now
Unlock full access