CHAPTER 7
Delegate
This chapter will discuss delegates. First, we will examine the C# delegate compared to the function pointer in C language, which will give you a basic idea of the similarity between the function pointer in C and delegate
in .NET. This will also build a background knowledge about the function pointer, which will help you understand the internal working of delegates. Finally, you will explore generic delegates such as Func
and Action
in .NET by examining how the C# compiler takes care of the Func
and Action
delegates.
Understanding Delegates
In .NET, a delegate defines a reference type that can be used to encapsulate a method ...
Get Expert C# 5.0: with the .NET 4.5 Framework now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.