TaskToAsyncResult.End Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
End(IAsyncResult) |
Waits for the Task wrapped by the IAsyncResult returned by Begin(Task, AsyncCallback, Object) to complete. |
End<TResult>(IAsyncResult) |
Waits for the Task<TResult> wrapped by the IAsyncResult returned by Begin(Task, AsyncCallback, Object) to complete. |
End(IAsyncResult)
- Source:
- TaskToAsyncResult.cs
- Source:
- TaskToAsyncResult.cs
Waits for the Task wrapped by the IAsyncResult returned by Begin(Task, AsyncCallback, Object) to complete.
public:
static void End(IAsyncResult ^ asyncResult);
public static void End (IAsyncResult asyncResult);
static member End : IAsyncResult -> unit
Public Shared Sub End (asyncResult As IAsyncResult)
Parameters
- asyncResult
- IAsyncResult
The IAsyncResult for which to wait.
Exceptions
asyncResult
is null
.
asyncResult
was not produced by a call to Begin(Task, AsyncCallback, Object).
Remarks
This will propagate any exception stored in the wrapped Task.
Applies to
End<TResult>(IAsyncResult)
- Source:
- TaskToAsyncResult.cs
- Source:
- TaskToAsyncResult.cs
Waits for the Task<TResult> wrapped by the IAsyncResult returned by Begin(Task, AsyncCallback, Object) to complete.
public:
generic <typename TResult>
static TResult End(IAsyncResult ^ asyncResult);
public static TResult End<TResult> (IAsyncResult asyncResult);
static member End : IAsyncResult -> 'Result
Public Shared Function End(Of TResult) (asyncResult As IAsyncResult) As TResult
Type Parameters
- TResult
The type of the result produced.
Parameters
- asyncResult
- IAsyncResult
The IAsyncResult for which to wait.
Returns
The result of the Task<TResult> wrapped by the IAsyncResult.
Exceptions
asyncResult
is null
.
asyncResult
was not produced by a call to Begin(Task, AsyncCallback, Object).
Remarks
This will propagate any exception stored in the wrapped Task<TResult>.