Esempio n. 1
0
		public void AddComment(PostComment comment)
		{
			var commentAdding = new CommentAddingEventArgs(this, comment);
			CommentAdding.Raise(commentAdding);
			if (commentAdding.Cancel)
				return;
			postRepository.SaveComment(comment);
			var commentAdded = new CommentAddedEventArgs(this, comment);
			CommentAdded.Raise(commentAdded);
		}
Esempio n. 2
0
 public Task <PolicyResult <Guid> > Handle(CommentAddedEventArgs request, CancellationToken cancellationToken)
 {
     return(this.executionPolicies.DbExecutionPolicy.ExecuteAndCaptureAsync(() => this.repository.AddCommentAsync(request.Comment)));
 }