using NCC; using System.Threading; using System.Threading.Tasks; namespace Microsoft.Extensions.Hosting { /// /// 监听泛型主机启动事件 /// internal class GenericHostLifetimeEventsHostedService : IHostedService { /// /// 构造函数 /// /// public GenericHostLifetimeEventsHostedService(IHost host) { // 存储根服务 InternalApp.RootServices = host.Services; } /// /// 监听主机启动 /// /// /// public Task StartAsync(CancellationToken cancellationToken) { return Task.CompletedTask; } /// /// 监听主机停止 /// /// /// public Task StopAsync(CancellationToken cancellationToken) { return Task.CompletedTask; } } }