public void UpdateComment(CommentModel model) { var comment = _commentRepository.Get(model.CommentID); Mapper.CopyProperties<CommentModel, Comment>(model, comment); _commentRepository.Update(comment); }
public void AddComment(CommentModel model) { var comment = new Comment(); Mapper.CopyProperties<CommentModel, Comment>(model, comment); comment.EntryID = model.Entry.EntryID; comment.Body = comment.RawBody.Sanitize(); _commentRepository.Add(comment); model.CommentID = comment.CommentID; }