Esempio n. 1
0
        public async Task <ActionResult <TicketDTO> > PostCommentAsync(int ticketId, CommentDTO comment)
        {
            if (!await _repo.UserExistsAsync(comment.Commenter.UserId))
            {
                return(NotFound("Commenter not found"));
            }

            await _repo.AddCommentAsync(ticketId, comment);

            return(CreatedAtAction(
                       nameof(GetAsync),
                       new { ticketId = ticketId },
                       await _repo.ReadTicketAsync(ticketId)
                       ));
        }