Utilize ASP.NET Core Application Lifetime Events

(Bipin Joshi) At times you need to know when your ASP.NET Core web application is being started and shutdown. One of the lesser known features of ASP.NET Core is the IApplicationLifetime interface that allows you to wire some logic when such application lifetime events occur.