I would like you to develop the mechanism to implement a graceful shutdown of Asp.Net Core 2.2 applications.
It should implement the IApplicationLifetime callbacks, and cancellation tokens.
To show it working properly, I would like you to create a Controller which uses a EFCore 2.2 database context and performs a long running operation on it (obviously passing the cancellation token). Alternatively you may do a HttpClient request to download a big quantity of data from somewhere, passing the cancellation token.
The mechanism should properly finalize execution of the database operation or download, then log a message on the console in the ApplicationStopping event, and only quit the application after logging a message on the console in the ApplicationStopped event as well.
To do this cleanly I suggest createing a base controller, derived from ControllerBase, which implements everything needed to work with the cancellation token from IApplicationLifetime. You then inherit your Controller from this base controller.
- Visual Studio 2017/2019 Solution with 1 AspNet Core 2.2 project.
MAXIMUM BUDGET: USD 20
Thanks for bidding.