Microsoft.Extensions.Hosting.IHostedLifecycleService
Defines methods that are run before or after
StartAsync and
StopAsync.
namespace Microsoft.Extensions.Hosting
{
public interface IHostedLifecycleService : IHostedService
{
Task StartingAsync(CancellationToken cancellationToken);
Task StartedAsync(CancellationToken cancellationToken);
Task StoppingAsync(CancellationToken cancellationToken);
Task StoppedAsync(CancellationToken cancellationToken);
}
}