Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Last active September 16, 2020 22:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcomartin/260ec63888fcb5946b96120d8727f9f0 to your computer and use it in GitHub Desktop.
Save dcomartin/260ec63888fcb5946b96120d8727f9f0 to your computer and use it in GitHub Desktop.
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