Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Created October 14, 2020 21:16
Show Gist options
  • Save dcomartin/4f8374d9aa3eea0f6e7d47dd6beeb70c to your computer and use it in GitHub Desktop.
Save dcomartin/4f8374d9aa3eea0f6e7d47dd6beeb70c to your computer and use it in GitHub Desktop.
using Hangfire;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
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.AddHangfire(configuration =>
{
configuration.UseSqlServerStorage("Server=localhost\\SQLEXPRESS;Database=Hangfire;Trusted_Connection=True;");
});
services.AddHangfireServer();
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment