Beispiel #1
0
 public ActionResult Answer(AnswerViewModel viewModel)
 {
     if (ModelState.IsValid)
     {
         Service.Answer(AnswerMapper.Map(viewModel));
     }
     return(GetQuestionAnswers(viewModel.QuestionId));
 }
        public async Task <ActionResult <IEnumerable <Answer> > > GetAnswers()
        {
            var userIdTKey = User.IsInRole("Admin") ? null : (Guid?)User.UserGuidId();

            return(Ok((await _uow.Answers.GetAllAsync(userIdTKey)).Select(e => _mapper.Map(e))));
        }