Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Created September 30, 2020 21:11
Show Gist options
  • Save dcomartin/8ddbd86a7df893cfcef38b6fa06dd8ea to your computer and use it in GitHub Desktop.
Save dcomartin/8ddbd86a7df893cfcef38b6fa06dd8ea to your computer and use it in GitHub Desktop.
using System.ComponentModel;
using System.Threading.Tasks;
using MediatR;
namespace Hangfire.MediatR
{
public class MediatorHangfireBridge
{
private readonly IMediator _mediator;
public MediatorHangfireBridge(IMediator mediator)
{
_mediator = mediator;
}
public async Task Send(IRequest command)
{
await _mediator.Send(command);
}
[DisplayName("{0}")]
public async Task Send(string jobName, IRequest command)
{
await _mediator.Send(command);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment