-
-
Save dcomartin/4090c0b9b4e05a361736287fab0c9624 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 Hangfire; | |
using Hangfire.MediatR; | |
using Microsoft.Extensions.Hosting; | |
using Sales; | |
using Shipping; | |
namespace Worker | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
CreateHostBuilder(args).Build().Run(); | |
} | |
private static IHostBuilder CreateHostBuilder(string[] args) => | |
Host.CreateDefaultBuilder(args) | |
.ConfigureServices(services => | |
{ | |
services.AddSales(); | |
services.AddShipping(); | |
services.AddHangfire(configuration => | |
{ | |
configuration.UseSqlServerStorage("Server=localhost\\SQLEXPRESS;Database=Hangfire;Trusted_Connection=True;"); | |
configuration.UseMediatR(); | |
}); | |
services.AddHangfireServer(); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment