Class AzureDocumentDbDataStoreExtensions
Provides a set of static (Shared in Visual Basic) methods for querying objects that inherit AzureDocumentDbDataStore<TData>.
Inheritance
Namespace: System.Linq
Assembly: Cqrs.Azure.DocumentDb.dll
Syntax
public static class AzureDocumentDbDataStoreExtensions : object
Methods
First<TData>(AzureDocumentDbDataStore<TData>)
Returns the first element of the sequence.
Declaration
public static TData First<TData>(this AzureDocumentDbDataStore<TData> source)where TData : AzureDocumentDbEntity
Parameters
Type | Name | Description |
---|---|---|
AzureDocumentDbDataStore<TData> | source | The sequence to type as |
Returns
Type | Description |
---|---|
TData | The first element of the sequence. |
Type Parameters
Name | Description |
---|---|
TData | The type of the elements of source. |
First<TData>(AzureDocumentDbDataStore<TData>, Func<TData, Boolean>)
Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists.
Declaration
public static TData First<TData>(this AzureDocumentDbDataStore<TData> source, Func<TData, bool> predicate)where TData : AzureDocumentDbEntity
Parameters
Type | Name | Description |
---|---|---|
AzureDocumentDbDataStore<TData> | source | The sequence to type as |
Func<TData, System.Boolean> | predicate | A function to test an element for a condition. |
Returns
Type | Description |
---|---|
TData | The first element of the sequence. |
Type Parameters
Name | Description |
---|---|
TData | The type of the elements of source. |
FirstOrDefault<TData>(AzureDocumentDbDataStore<TData>)
Returns the first element of the sequence that satisfies a condition or a default value if no such element is found.
Declaration
public static TData FirstOrDefault<TData>(this AzureDocumentDbDataStore<TData> source)where TData : AzureDocumentDbEntity
Parameters
Type | Name | Description |
---|---|---|
AzureDocumentDbDataStore<TData> | source | The sequence to type as |
Returns
Type | Description |
---|---|
TData | The first element of the sequence. |
Type Parameters
Name | Description |
---|---|
TData | The type of the elements of source. |
FirstOrDefault<TData>(AzureDocumentDbDataStore<TData>, Func<TData, Boolean>)
Returns the first element of a sequence, or a default value if the sequence contains no elements.
Declaration
public static TData FirstOrDefault<TData>(this AzureDocumentDbDataStore<TData> source, Func<TData, bool> predicate)where TData : AzureDocumentDbEntity
Parameters
Type | Name | Description |
---|---|---|
AzureDocumentDbDataStore<TData> | source | The sequence to type as |
Func<TData, System.Boolean> | predicate | A function to test an element for a condition. |
Returns
Type | Description |
---|---|
TData | The first element of the sequence. |
Type Parameters
Name | Description |
---|---|
TData | The type of the elements of source. |
Single<TData>(AzureDocumentDbDataStore<TData>)
Returns the only element of the sequence, and throws an exception if there is not exactly one element in the sequence.
Declaration
public static TData Single<TData>(this AzureDocumentDbDataStore<TData> source)where TData : AzureDocumentDbEntity
Parameters
Type | Name | Description |
---|---|---|
AzureDocumentDbDataStore<TData> | source | The sequence to type as |
Returns
Type | Description |
---|---|
TData | The single element of the sequence. |
Type Parameters
Name | Description |
---|---|
TData | The type of the elements of source. |
Single<TData>(AzureDocumentDbDataStore<TData>, Func<TData, Boolean>)
Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists.
Declaration
public static TData Single<TData>(this AzureDocumentDbDataStore<TData> source, Func<TData, bool> predicate)where TData : AzureDocumentDbEntity
Parameters
Type | Name | Description |
---|---|---|
AzureDocumentDbDataStore<TData> | source | The sequence to type as |
Func<TData, System.Boolean> | predicate | A function to test an element for a condition. |
Returns
Type | Description |
---|---|
TData | The single element of the sequence. |
Type Parameters
Name | Description |
---|---|
TData | The type of the elements of source. |
SingleOrDefault<TData>(AzureDocumentDbDataStore<TData>)
Returns the only element of the 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.
Declaration
public static TData SingleOrDefault<TData>(this AzureDocumentDbDataStore<TData> source)where TData : AzureDocumentDbEntity
Parameters
Type | Name | Description |
---|---|---|
AzureDocumentDbDataStore<TData> | source | The sequence to type as |
Returns
Type | Description |
---|---|
TData | The single element of the sequence. |
Type Parameters
Name | Description |
---|---|
TData | The type of the elements of source. |
SingleOrDefault<TData>(AzureDocumentDbDataStore<TData>, Func<TData, Boolean>)
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.
Declaration
public static TData SingleOrDefault<TData>(this AzureDocumentDbDataStore<TData> source, Func<TData, bool> predicate)where TData : AzureDocumentDbEntity
Parameters
Type | Name | Description |
---|---|---|
AzureDocumentDbDataStore<TData> | source | The sequence to type as |
Func<TData, System.Boolean> | predicate | A function to test an element for a condition. |
Returns
Type | Description |
---|---|
TData | The single element of the sequence. |
Type Parameters
Name | Description |
---|---|
TData | The type of the elements of source. |