/// <inheritdoc/> public virtual async Task StopAsync( CancellationToken cancellationToken) { using var serviceScope = _serviceScopeFactory.CreateScope(); DependencyInjectionLogMessages.ServiceScopeCreated(_logger, serviceScope); await OnStoppingAsync( serviceScope.ServiceProvider, cancellationToken); }
public async Task StartAsync( CancellationToken cancellationToken) { using var logScope = HostingLogMessages.BeginStartupActionScope(_logger, this); HostingLogMessages.StartupActionExecuting(_logger); using var serviceScope = _serviceScopeFactory.CreateScope(); DependencyInjectionLogMessages.ServiceScopeCreated(_logger, serviceScope); await OnStartingAsync( serviceScope.ServiceProvider, cancellationToken); HostingLogMessages.StartupActionExecuted(_logger); _whenDone.SetResult(null); }