Esempio n. 1
0
        public ActionResult PutNewRightAnswer([FromBody] AnswerWithoutIDInputModel answer)
        {
            QuestionCRUD question = new QuestionCRUD();

            if (!question.GetAll().Any(x => x.ID == answer.QuestionID))
            {
                return(BadRequest("Вопроса с таким ID не существует"));
            }
            AuthorDataAccess author = new AuthorDataAccess();

            return(Ok(author.UpdateRightAnswer(answer.QuestionID, answer.Value)));
        }