Пример #1
0
        public async Task <SurveyDto> GetSurveyById(int id)
        {
            var survey = await _surveyRepository.GetAsync(id);

            var questionOrders = await _questionOrderRepository.GetQuestionOrdersByForeignId(id, (int)CallerType.Survey);

            var dto = _mapper.Map <SurveyDto>(survey);

            dto.QuestionOrders = _mapper.Map <IEnumerable <QuestionOrderDto> >(questionOrders);

            return(dto);
        }
Пример #2
0
        public async Task <IEnumerable <QuestionOrderDto> > GetQuestionOrdersBySurveyId(int id)
        {
            var questionOrders = await _questionOrderRepository.GetQuestionOrdersByForeignId(id, (int)CallerType.Survey);

            return(_mapper.Map <IEnumerable <QuestionOrderDto> >(questionOrders).OrderBy(q => q.OrderNbr));
        }