Beispiel #1
0
        public ActionResult <FeedbackQuestionOutputModel> GetFeedbackByIdWithAllInfo(int feedbackId)
        {
            Mapper           mapper    = new Mapper();
            AuthorDataAccess feedbacks = new AuthorDataAccess();
            var feedback = feedbacks.GetFeedbackWithQuestion(feedbackId);

            if (feedback == null)
            {
                return(BadRequest("Фитбека не существует"));
            }
            FeedbackQuestionOutputModel model = mapper.ConvertFeedbackQuestionDTOToFeedbackQuestionOutputModel(feedback);

            model.Answers = mapper.ConvertAnswerDTOToAnswerModelList(feedbacks.GetAllAnswersByFeedbackId(feedbackId));
            return(Ok(model));
        }