Method SingleAsync
SingleAsync<TResult>(IAggregateFluent<TResult>, CancellationToken)
Returns the only document of the aggregate result. Throws an exception if the result set does not contain exactly one document.
public static Task<TResult> SingleAsync<TResult>(this IAggregateFluent<TResult> aggregate, CancellationToken cancellationToken = default)
Parameters
aggregateIAggregateFluent<TResult>The aggregate.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- Task<TResult>
The fluent aggregate interface.
Type Parameters
TResultThe type of the result.