Exemplo n.º 1
0
        public ISpecification <T> Shard <T>(ISpecification <T> spec, ShardParams shardParams)
        {
            LinqSpecification <T> linqSpec = (LinqSpecification <T>)spec;

            linqSpec.ShardParams = shardParams;
            return(linqSpec);
        }
Exemplo n.º 2
0
        public ISpecification <T> Take <T>(ISpecification <T> spec, int count)
        {
            LinqSpecification <T> linqSpec = (LinqSpecification <T>)spec;

            linqSpec.Take = count;
            return(linqSpec);
        }
Exemplo n.º 3
0
        public ISpecification <T> Skip <T>(ISpecification <T> spec, int count)
        {
            LinqSpecification <T> linqSpec = (LinqSpecification <T>)spec;

            linqSpec.Skip = count;
            return(linqSpec);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
        public int Count(ISpecification <TEntity> spec)
        {
            LinqSpecification <TEntity> linqSpec = (LinqSpecification <TEntity>)spec;

            return(linqSpec.Query.Count());
        }
Exemplo n.º 7
0
        public IList <TEntity> FindAll(ISpecification <TEntity> spec)
        {
            LinqSpecification <TEntity> linqSpec = (LinqSpecification <TEntity>)spec;

            return(linqSpec.Query.ToList());
        }
Exemplo n.º 8
0
        public TEntity FindOne(ISpecification <TEntity> spec)
        {
            LinqSpecification <TEntity> linqSpec = (LinqSpecification <TEntity>)spec;

            return(linqSpec.Query.FirstOrDefault());
        }