Class TaskExtensions
- Namespace
- Savvyio
- Assembly
- Savvyio.Core.dll
Extension methods for the Task<TResult> class.
public static class TaskExtensions
- Inheritance
-
objectTaskExtensions
Methods
SingleOrDefaultAsync<T>(Task<IEnumerable<T>>)
Asynchronously returns the only element of a sequence, or a default value if the sequence is empty; this method throws an exception if there is more than one element in the sequence.
public static Task<T> SingleOrDefaultAsync<T>(this Task<IEnumerable<T>> source)
Parameters
sourceTask<IEnumerable<T>>The Task<TResult> to return the single element of.
Returns
- Task<T>
A task that represents the asynchronous operation. The task result contains the single element of the input sequence, or default (TSource) if the sequence contains no elements.
Type Parameters
TThe type of the elements of
source.