Exemplo n.º 1
0
        public bool Update(CreateUpdateCommentViewModel model)
        {
            if (string.IsNullOrEmpty(model.BodyText))
            {
                return(false);
            }
            var comment = model.AsComment();

            comment.CreationTime = DateTime.UtcNow;
            return(commentRepository.Update(comment));
        }
Exemplo n.º 2
0
 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);
     }
 }