Delegate AsyncFunc<T, TResult>
Encapsulates an asynchronous method that has one parameter 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<in T, TResult>(T obj);
Parameters
Type | Name | Description |
---|---|---|
T | obj |
Returns
Type | Description |
---|---|
Task<TResult> |
Type Parameters
Name | Description |
---|---|
T | |
TResult |
Examples
Say you have a method with the signature
Task DoThing(int x, string s, Func<int, Task<string>> thing)
You can refactor this to
Task DoThing(int x, string s, AsyncFunc<int, string> thing)