Skip to content

Instantly share code, notes, and snippets.

@dcomartin

dcomartin/MediatorExtensions.cs Secret

Created Sep 30, 2020
Embed
What would you like to do?
using MediatR;
namespace Hangfire.MediatR
{
public static class MediatorExtensions
{
public static void Enqueue(this IMediator mediator, string jobName, IRequest request)
{
var client = new BackgroundJobClient();
client.Enqueue<MediatorHangfireBridge>(bridge => bridge.Send(jobName, request));
}
public static void Enqueue(this IMediator mediator,IRequest request)
{
var client = new BackgroundJobClient();
client.Enqueue<MediatorHangfireBridge>(bridge => bridge.Send(request));
}
}
}
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.