Exemplo n.º 1
0
        public virtual IActionResult AddCommentToApplication([FromRoute] Guid applicationId,
                                                             [FromBody] CommentCreateDto comment)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            var newComment = _applicationRepository.AddCommentToApplication(applicationId, comment);

            _applicationRepository.Save();

            var location = $"/comments/{newComment.Id}";

            return(Created(location, newComment));
        }