예제 #1
0
        public async Task <IActionResult> AddAnswers(List <CreateAnswerDto> answerDtos)
        {
            var answersResponse = await _answer.AddAnswers(answerDtos, GetUserEmail());

            var response = new Response <List <GetAnswerDto> >(answersResponse);

            return(answersResponse.Code switch
            {
                HttpStatusCode.NotFound => NotFound(response),
                HttpStatusCode.UnprocessableEntity => UnprocessableEntity(response),
                HttpStatusCode.Conflict => Conflict(response),
                _ => Ok(response)
            });