public ISpecification <T> Shard <T>(ISpecification <T> spec, ShardParams shardParams) { LinqSpecification <T> linqSpec = (LinqSpecification <T>)spec; linqSpec.ShardParams = shardParams; return(linqSpec); }
public ISpecification <T> Take <T>(ISpecification <T> spec, int count) { LinqSpecification <T> linqSpec = (LinqSpecification <T>)spec; linqSpec.Take = count; return(linqSpec); }
public ISpecification <T> Skip <T>(ISpecification <T> spec, int count) { LinqSpecification <T> linqSpec = (LinqSpecification <T>)spec; linqSpec.Skip = count; return(linqSpec); }
public IOrderedSpecification <T> ThenBy <T, K>(IOrderedSpecification <T> spec, Expression <Func <T, K> > keySelector, QueryOrder order) { LinqSpecification <T> linqSpec = (LinqSpecification <T>)spec; ((IList <QueryOrderExpression>)linqSpec.ThenByExpressions).Add(QueryOrderExpression.CreateTheneBy(keySelector, order)); return(linqSpec); }
public IOrderedSpecification <T> OrderBy <T, K>(ISpecification <T> spec, Expression <Func <T, K> > keySelector, QueryOrder order) { LinqSpecification <T> linqSpec = (LinqSpecification <T>)spec; linqSpec.OrderByExpression = QueryOrderExpression.CreateOrderBy(keySelector, order); return(linqSpec); }
public int Count(ISpecification <TEntity> spec) { LinqSpecification <TEntity> linqSpec = (LinqSpecification <TEntity>)spec; return(linqSpec.Query.Count()); }
public IList <TEntity> FindAll(ISpecification <TEntity> spec) { LinqSpecification <TEntity> linqSpec = (LinqSpecification <TEntity>)spec; return(linqSpec.Query.ToList()); }
public TEntity FindOne(ISpecification <TEntity> spec) { LinqSpecification <TEntity> linqSpec = (LinqSpecification <TEntity>)spec; return(linqSpec.Query.FirstOrDefault()); }