What’s the different between an async delegate and async method?
Someone told me they were different in C#, but I thought they were the same thing.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Delegates first. When you declare one, the compiler automatically generates three methods for the delegate type:
The Invoke() method calls the delegate target synchronously, just like a plain call. The BeginInvoke() method is the asynchronous call, the target method runs on a thread-pool thread. The EndInvoke() call is required after the method completes to release resources allocated for the call and to re-raise any exception that might have aborted the call.
The .NET framework contains many classes that have a BeginXxxx() method. The MSDN Library refers to them as asynchronous operations, not asynchronous methods. They start an operation that completes asynchronously.
Starting with .NET 4.5 and supported by C# version 5, the asynchronous operations whose name end in Async and return a Task can be called in an await expression. When used in a method that has the async modifier. This greatly simplifies dealing with asynchronous operations, important in WinRT where many common operations are asynchronous.