public List <ChallengesDescriptionViewModel> GetChallenges(SortedPageRule sortedPageRule)
        {
            Contract.Requires <ArgumentException>(sortedPageRule.IsValid);

            var queryParameters = new QueryParameters
            {
                PageRule = sortedPageRule
            };

            PrepareQueryParameters(queryParameters, sortedPageRule.SortingType);

            var challenges = unitOfWork.GetAll <Challenge>(queryParameters);

            return(mapper.Map <List <ChallengesDescriptionViewModel> >(challenges));
        }
Example #2
0
 public IEnumerable <ChallengesDescriptionViewModel> GetChallenges([FromBody] SortedPageRule sortedPageRule)
 {
     return(challengesService.GetChallenges(sortedPageRule));
 }