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); }
public IActionResult AddComment([FromBody] AddPostCommentCommand comment) { return(Ok(_postCommentsService.AddComment(comment))); }