/// <summary>
        /// Applies sort queries
        /// </summary>
        /// <param name="entities"></param>
        /// <returns></returns>
        protected virtual IQueryable <TResource> ApplySort(IQueryable <TResource> entities)
        {
            var queries = _sortService.Get();

            entities = _repository.Sort(entities, queries);
            return(entities);
        }
        /// <summary>
        /// Applies sort queries
        /// </summary>
        /// <param name="entities"></param>
        /// <returns></returns>
        protected virtual IQueryable <TResource> ApplySort(IQueryable <TResource> entities)
        {
            var queries = _sortService.Get();

            if (queries != null && queries.Any())
            {
                foreach (var query in queries)
                {
                    entities = _repository.Sort(entities, query);
                }
            }

            return(entities);
        }