public void Create(CommentViewModel commentView) { var comment = Mapper.Map<CommentViewModel, Comment>(commentView); comment.CommentBy = _db.Users.Get(commentView.CommentBy); comment.CommentTo = _db.Nodes.Get(commentView.CommentTo); comment.Date = DateTime.Now; _db.Comments.Create(comment); _db.Save(); }
public List<CommentViewModel> CreateCommentToNode(CommentViewModel commentView) { _commentsService.Create(commentView); return _commentsService.Get(commentView.CommentTo); }