7 implementations of IHostLifetime
Microsoft.AspNetCore.TestHost (1)
NoopHostLifetime.cs (1)
8internal sealed class NoopHostLifetime : IHostLifetime
Microsoft.AspNetCore.Tests (1)
WebApplicationTests.cs (1)
3028private class CustomHostLifetime : IHostLifetime
Microsoft.Extensions.Hosting (3)
Internal\ConsoleLifetime.cs (1)
21public partial class ConsoleLifetime : IHostLifetime, IDisposable
Internal\ConsoleLifetime.netcoreapp.cs (1)
10public partial class ConsoleLifetime : IHostLifetime
Internal\NullLifetime.cs (1)
12internal sealed class NullLifetime : IHostLifetime
Microsoft.Extensions.Hosting.Systemd (1)
SystemdLifetime.cs (1)
20public partial class SystemdLifetime : IHostLifetime, IDisposable
Microsoft.Extensions.Hosting.WindowsServices (1)
WindowsServiceLifetime.cs (1)
18public class WindowsServiceLifetime : ServiceBase, IHostLifetime
20 references to IHostLifetime
Microsoft.AspNetCore.TestHost (2)
WebHostBuilderExtensions.cs (2)
28services.AddSingleton<IHostLifetime, NoopHostLifetime>(); 44services.AddSingleton<IHostLifetime, NoopHostLifetime>();
Microsoft.AspNetCore.TestHost.Tests (1)
TestServerTests.cs (1)
87Assert.IsType<NoopHostLifetime>(host.Services.GetService<IHostLifetime>());
Microsoft.AspNetCore.Tests (8)
WebApplicationTests.cs (8)
1554builder.Services.AddSingleton<IHostLifetime, CustomHostLifetime>(); 1558var hostLifetime0 = app.Services.GetRequiredService<IHostLifetime>(); 1560var hostLifetime1 = childServiceProvider.GetRequiredService<IHostLifetime>(); 1562var hostLifetimes0 = app.Services.GetServices<IHostLifetime>().ToArray(); 1563var hostLifetimes1 = childServiceProvider.GetServices<IHostLifetime>().ToArray(); 2423Assert.Contains(builder.Services, service => service.ServiceType == typeof(IHostLifetime));
Microsoft.Extensions.Hosting (7)
HostBuilder.cs (1)
325appServices.GetRequiredService<IHostLifetime>(),
HostBuilder.netcoreapp.cs (2)
16services.AddSingleton<IHostLifetime, ConsoleLifetime>(); 20services.AddSingleton<IHostLifetime, NullLifetime>();
HostingHostBuilderExtensions.cs (2)
347return hostBuilder.ConfigureServices(collection => collection.AddSingleton<IHostLifetime, ConsoleLifetime>()); 365collection.AddSingleton<IHostLifetime, ConsoleLifetime>();
Internal\Host.cs (2)
24private readonly IHostLifetime _hostLifetime; 39IHostLifetime hostLifetime,
Microsoft.Extensions.Hosting.Systemd (1)
SystemdHostBuilderExtensions.cs (1)
89services.AddSingleton<IHostLifetime, SystemdLifetime>();
Microsoft.Extensions.Hosting.WindowsServices (1)
WindowsServiceLifetimeHostBuilderExtensions.cs (1)
120services.AddSingleton<IHostLifetime, WindowsServiceLifetime>();