Delegate AsyncFunc<TResult>
Encapsulates an asynchronous method that has no parameters and returns a value of the type specified by the TResult
parameter.
Equivalent to Func<Task<TResult>>
.
Namespace: Recore
Assembly: Recore.dll
Syntax
public delegate Task<TResult> AsyncFunc<TResult>();
Returns
Type | Description |
---|---|
Task<TResult> |
Type Parameters
Name | Description |
---|---|
TResult |
Examples
Say you have a method with the signature
Task DoThing(int x, string s, Func<Task<string>> thing)
You can refactor this to
Task DoThing(int x, string s, AsyncFunc<string> thing)