Class SqlDataStoreExtensions
A collection of extension methods for IDataStore<TData>
Inheritance
System.Object
SqlDataStoreExtensions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Cqrs.Sql.DataStores
Assembly: Cqrs.Sql.dll
Syntax
public static class SqlDataStoreExtensions
Methods
Single<TEntity, TDbEntity>(IEnumerable<TEntity>)
Use this one... Returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence.
Declaration
public static TEntity Single<TEntity, TDbEntity>(this IEnumerable<TEntity> dataStore)where TEntity : new ()where TDbEntity : class, new ()
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<TEntity> | dataStore |
Returns
Type | Description |
---|---|
TEntity |
Type Parameters
Name | Description |
---|---|
TEntity | |
TDbEntity |
Where<TEntity, TDbEntity>(IDataStore<TEntity>, Expression<Func<TEntity, Boolean>>)
Use this one... Filters a sequence of values based on a predicate.
Declaration
public static IQueryable<TEntity> Where<TEntity, TDbEntity>(this IDataStore<TEntity> dataStore, Expression<Func<TEntity, bool>> predicate)where TDbEntity : class, new ()
Parameters
Type | Name | Description |
---|---|---|
IDataStore<TEntity> | dataStore | |
System.Linq.Expressions.Expression<System.Func<TEntity, System.Boolean>> | predicate |
Returns
Type | Description |
---|---|
System.Linq.IQueryable<TEntity> |
Type Parameters
Name | Description |
---|---|
TEntity | |
TDbEntity |