Exemple #1
0
        /// <summary>
        /// Maps <paramref name="addQuestionDTO"/> to <c><b>Question</b></c>  object and adds that product to repository.
        /// </summary>
        /// <param name="addQuestionDTO">Question to be added.</param>
        /// <returns></returns>
        public async Task AddQuestionAsync(AddQuestionDTO addQuestionDTO)
        {
            var question = new Question
            {
                Title           = addQuestionDTO.Title,
                QuestionContent = addQuestionDTO.QuestionContent,
            };

            await _questionRepository.AddAsync(question).ConfigureAwait(false);
        }
 public async Task <IActionResult> AddQuestion([FromBody] AddQuestionDTO addQuestion)
 {
     return(await _questionService.AddQuestionAsync(addQuestion).ConfigureAwait(false).GetObjectResponseAsync <AddQuestionDTO>("Success").ConfigureAwait(false));
 }