Doing Some Cleanup in a BackgroundService

Download full source code. There is something a little strange about the Worker Service template and its BackgroundService in .NET. You can create a new Worker Service project using - `dotnet new worker -n MyWorker The Problem The Worker class uses a BackgroundService as its base class. The Worker has an ExecuteAsync(...) method that is called when the service is started, and it takes a…