python ruby-programming-language Smalltalk Vue.js Knockoutjs TypeScript JavaScript, OOPs JavaScript Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 4 Angular 2 AngularJs 1.x NodeJs Perl Programming R Programming RequireJs Rust Programming Backbonejs closure programming language go-programming-language kotlin-programming-language
delegates in c#

What are ASP.NET Delegates, Types and Examples?

Delegate, Multicast Delegate and Generic Delegate

DelegateMulticast DelegateGeneric Delegate

Multiple Examples and Live Results

Single Delegates ExamplesMapped Delegate Static and Instance Methods
Multicast Delegate ExamplesWhat are Generic Delegates, Types and Examples
What is “Delegate”? What are different “Types” of Delegate? What is “Multicast Delegate”?What is “Generic Delegate”?
Delegate is an object which holds the references to a method within delegate object.
Delegate is a type-safe object.
Delegate is invoking to methods in asynchronously manner. 
Delegate encapsulates a static method or instance methods. 
Delegate can be with parameters or without parameters. 

Delegate’s benefits,
  1) Improve the performance of application. 
  2) Encapsulate to methods call from caller. 
  3) Call a method asynchronously.

Three steps for using Delegates,
  1) Declare
  2) Create 
  3) Point

Syntax: -   public delegate delegate_type delegate_name();
Types of Delegates,

  1) Delegate
A delegate is use when you need to pass to single reference to a method within delegate object. Multicast Delegate is use when we needed to pass the more than one reference to a method within delegate object.

I hope you are enjoying with this post! Please share with you friends. Thank you!!!

Hey! I'm Anil Singh. I author this blog. I'm Active Blogger, Programmer. I love learning new technologies, programming, blogging and participating the forum discussions more...
My Blogs - and
My Books - Interview Questions and Answers Books- Get Your Book in 15+ Digital Stores Worldwide..

You Might Also Like Powered by Blogger.
ASK Questions