Ejemplo n.º 1
0
 public ActionResult Answer(AnswerViewModel viewModel)
 {
     if (ModelState.IsValid)
     {
         Service.Answer(AnswerMapper.Map(viewModel));
     }
     return(GetQuestionAnswers(viewModel.QuestionId));
 }
Ejemplo n.º 2
0
        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))));
        }