Exemplo n.º 1
0
        public DeleteCommentResponse Delete(DeleteCommentRequest request)
        {
            var validator        = validatorFactory.GetValidator();
            var validationResult = validator.Validate(request);

            if (!validationResult.IsSuccess)
            {
                return(responseCreator(validationResult));
            }

            using (var tran = transactionCreator.GetTransaction())
            {
                var comment = data.Get(request.CommentId);
                comment.Ticket.Comments.Remove(comment);
                tran.Commit();
            }

            return(responseCreator(validationResult));
        }
 public IIdentity <Comment> GetTargetEntityIdentity(DeleteCommentRequest value)
 => value.CommentId;