Method CastTo
CastTo<TNew>(Func<T, ValueTask<TNew>>, bool)
Casts the result of this task to a new type using the specified converter function.
Declaration
public TaskWithProgress<TNew> CastTo<TNew>(Func<T, ValueTask<TNew>> converter, bool continueOnCapturedContext = true)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<T, ValueTask<TNew>> | converter | |
| bool | continueOnCapturedContext |
Returns
| Type | Description |
|---|---|
| TaskWithProgress<TNew> |
Type Parameters
| Name | Description |
|---|---|
| TNew |
Remarks
This is only valid if the task has not begun yet, and consumes the current instance of the task to create it.