コード例 #1
0
        public PostComments AddComment(AddPostCommentCommand comment)
        {
            ImagesManager.ImageCommentCountPlus(_paintStoreContext, comment.PostId);
            var commentToAdd = _mapper.Map <PostComments>(comment);

            commentToAdd.CreationDate = DateTime.Now;
            _paintStoreContext.PostComments.Add(commentToAdd);
            _paintStoreContext.SaveChanges();
            return(commentToAdd);
        }
コード例 #2
0
 public IActionResult AddComment([FromBody] AddPostCommentCommand comment)
 {
     return(Ok(_postCommentsService.AddComment(comment)));
 }