public bool Update(CreateUpdateCommentViewModel model) { if (string.IsNullOrEmpty(model.BodyText)) { return(false); } var comment = model.AsComment(); comment.CreationTime = DateTime.UtcNow; return(commentRepository.Update(comment)); }
public bool Create(CreateUpdateCommentViewModel model) { try { var comment = new Comment(); comment.CreationTime = DateTime.UtcNow; comment = model.AsComment(); comment.CommentId = 0; commentRepository.Add(comment); return(true); } catch { return(false); } }