Represents an Umbraco application lifetime (starting, started, stopping, stopped) notification
Umbraco application lifetime notifications are published for the starting, started, stopping, and stopped events of the Umbraco runtime. These events implement the IUmbracoApplicationLifetimeNotification interface that contains a single IsRestarting property.
An Umbraco application is restarted after an install or upgrade has been completed. You can use this property to prevent running code twice: on initial boot and restart. To prevent running code when the application is in the install or upgrade state, inject an IRuntimeState instance in your notification and inspect the Level property instead.
Usage
Example usage of the UmbracoApplicationLifetime notifications: