Skip to content

Instantly share code, notes, and snippets.

@corespider
Created August 23, 2020 08:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save corespider/36b6537b2ba61bce2165cb89051d1d93 to your computer and use it in GitHub Desktop.
Save corespider/36b6537b2ba61bce2165cb89051d1d93 to your computer and use it in GitHub Desktop.
Worker Service in .NET Core-AddHostedService
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureServices((hostContext, services) =>
{
services.AddHostedService<Worker>();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment