예제 #1
0
        public Task HandleAsync(DoSomethingWithCancellationCommand command, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (cancellationToken == null)
            {
                throw new TestCommandHandlerException("Cancellation token is null. Please check registration.");
            }

            base.HandleAsync(command);
            return(Task.CompletedTask);
        }
예제 #2
0
        public Task DoSomethingAsync(DoSomethingWithCancellationCommand command, CancellationToken ctx)
        {
            if (ctx == null)
            {
                return(Task.FromException(new TestCommandHandlerException("Cancellation token is null. Please check attribute registration.")));
            }

            base.HandleAsync(command);
            return(Task.CompletedTask);
        }