Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ internal class GreetingCommandRequestHandlerAsync : RequestHandlerAsync<Greeting
[RequestLoggingAsync(step: 1, timing: HandlerTiming.Before)]
public override async Task<GreetingCommand> HandleAsync(GreetingCommand command, CancellationToken cancellationToken = default)
{
Console.WriteLine("Hello {0}}", command.Name);
Console.WriteLine("Hello {0}", command.Name);

return await base.HandleAsync(command, cancellationToken).ConfigureAwait(ContinueOnCapturedContext);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#region Licence
#region Licence
/* The MIT License (MIT)
Copyright © 2015 Ian Cooper <ian_hammond_cooper@yahoo.co.uk>

Expand Down Expand Up @@ -29,13 +29,13 @@ THE SOFTWARE. */

namespace HelloWorld
{
internal class GreetingCommandHandler : RequestHandler<GreetingCommand>
internal class GreetingCommandHandler : RequestHandlerAsync<GreetingCommand>
{
[RequestLogging(step: 1, timing: HandlerTiming.Before)]
public override GreetingCommand Handle(GreetingCommand command)
[RequestLoggingAsync(step: 1, timing: HandlerTiming.Before)]
public override async Task<GreetingCommand> HandleAsync(GreetingCommand command, CancellationToken cancellationToken)
{
Console.WriteLine("Hello {0}", command.Name);
return base.Handle(command);
return await base.HandleAsync(command, cancellationToken);
}
}
}
3 changes: 3 additions & 0 deletions src/Paramore.Brighter/RequestHandlerAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ public abstract class RequestHandlerAsync<TRequest> : IHandleRequestsAsync<TRequ
/// <param name="successor">The successor.</param>
public void SetSuccessor(IHandleRequestsAsync<TRequest> successor)
{
if (this == successor)
return;

_successor = successor;
}

Expand Down