CoreTaskExtensionsSelectTSource, TResult Method (TaskTSource, FuncTaskTSource, TResult) |
Namespace: Rackspace.Threading
public static Task<TResult> Select<TSource, TResult>( this Task<TSource> task, Func<Task<TSource>, TResult> continuationFunction )
Exception | Condition |
---|---|
ArgumentNullException |
If task is . -or- If continuationFunction is . |
This code implements support for the following construct without requiring the use of /.
TSource source = await task.ConfigureAwait(false); return continuationFunction(task);
If the antecedent task is canceled or faulted, the status of the antecedent is directly applied to the task returned by this method; it is not wrapped in an additional AggregateException.
Notes to Callers |
---|
Since the continuation is executed synchronously, this method should only be used for lightweight continuation functions. For non-trivial continuation functions, use ThenTSource, TResult(TaskTSource, FuncTaskTSource, TaskTResult) instead. |