Skip to content

Instantly share code, notes, and snippets.

@dcomartin

dcomartin/behavior.cs

Last active Sep 16, 2020
Embed
What would you like to do?
public class DemoBehavior : IPipelineBehavior<PlaceOrder, Unit>
{
private readonly ILogger<DemoBehavior> _logger;
public DemoBehavior(ILogger<DemoBehavior> logger)
{
_logger = logger;
}
public async Task<Unit> Handle(PlaceOrder request, CancellationToken cancellationToken, RequestHandlerDelegate<Unit> next)
{
_logger.LogInformation($"Handling {nameof(PlaceOrder)}");
var response = await next();
return response;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.