-
-
Save dcomartin/cc95718ca86bb41dec2ec3efe09d9a9d 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 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