Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
public class LogCommandHandler : IRequestHandler<LogCommand>
private readonly ILogger<LogCommandHandler> _logger;
public LogCommandHandler(ILogger<LogCommandHandler> logger) => _logger = logger;
public Task<Unit> Handle(LogCommand request, CancellationToken cancellationToken)
_logger.LogInformation("---- Received message: {Message} ----", request.Message);
return Task.FromResult(Unit.Value);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment