Skip to content

Instantly share code, notes, and snippets.

@cilliemalan
Created November 18, 2019 11:51
Show Gist options
  • Save cilliemalan/9b60ab2e12360b46f55178352ec8b79b to your computer and use it in GitHub Desktop.
Save cilliemalan/9b60ab2e12360b46f55178352ec8b79b to your computer and use it in GitHub Desktop.
public class MyBackgroundService : BackgroundService
{
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
while (!stoppingToken.IsCancellationRequested)
{
await DoWorkAsync(stoppingToken);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment