-
-
Save dcomartin/8ddbd86a7df893cfcef38b6fa06dd8ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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