Exemplo n.º 1
0
        /// <summary>
        /// Computes the sorts.
        /// </summary>
        public void Sort()
        {
            IQueryable <TEntity> sortedQuery = null;

            if (this.queryParameters.Sorts != null)
            {
                bool isMultiple = false;
                foreach (SortDescriptor sort in this.queryParameters.Sorts)
                {
                    MemberBinder <TEntity> binder = this.GetBinding(sort.MemberName);
                    sortedQuery = binder.Sort(sortedQuery ?? this.query, sort, isMultiple);
                    isMultiple  = true;
                }
            }

            if (sortedQuery != null)
            {
                this.query = sortedQuery;
            }
        }