CQRS.NET  2.2
A lightweight enterprise framework to write CQRS, event-sourced and micro-service applications in hybrid multi-datacentre, on-premise and Azure environments.

◆ Single< TData >() [2/2]

static TData System.Linq.AzureDocumentDbDataStoreExtensions.Single< TData > ( this AzureDocumentDbDataStore< TData >  source,
Func< TData, bool >  predicate 
)
static

Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists.

Parameters
predicateA function to test an element for a condition.
sourceThe sequence to type as IEnumerable<T>.
Template Parameters
TDataThe type of the elements of source.
Returns
The single element of the sequence.
Exceptions
ArgumentNullExceptionpredicate is null.
InvalidOperationExceptionThe sequence is empty.
Type Constraints
TData :AzureDocumentDbEntity