Exemplo n.º 1
0
        protected IQueryable <TEntity> GetQuery(ISpecification <TEntity> specification = null, IFetch <TEntity> fetch = null, ISort <TEntity> sort = null)
        {
            var query = dbSet.AsQueryable();

            if (specification != null)
            {
                query = query.Where(specification.IsSatisfiedBy());
            }
            if (sort != null)
            {
                query = sort.AcceptQuery(query);
            }
            if (fetch != null)
            {
                query = fetch.AcceptQuery(query);
            }
            return(query);
        }