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.

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

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

Returns the only element of the sequence that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition.

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.
Type Constraints
TData :AzureDocumentDbEntity