Implemented interface member:
property
Services
Microsoft.Extensions.Hosting.IHost.Services
59 references to Services
Aspire.Dashboard (7)
DashboardWebApplication.cs (7)
170_dashboardOptionsMonitor = _app.Services.GetRequiredService<IOptionsMonitor<DashboardOptions>>(); 173Services = _app.Services; 276_dashboardOptionsMonitor = _app.Services.GetRequiredService<IOptionsMonitor<DashboardOptions>>(); 278Services = _app.Services; 296var corsOptions = _app.Services.GetRequiredService<IOptions<CorsOptions>>().Value; 332var options = _app.Services.GetRequiredService<IOptionsMonitor<DashboardOptions>>().CurrentValue; 456return _app.Services.GetRequiredService<ILoggerFactory>().CreateLogger<DashboardWebApplication>();
Aspire.Hosting (1)
Dashboard\DashboardServiceHost.cs (1)
203var addressFeature = _app.Services.GetService<IServer>()?.Features.Get<IServerAddressesFeature>();
Microsoft.AspNetCore.Authentication.Test (1)
AuthenticationMiddlewareTests.cs (1)
179var options = app.Services.GetService<IOptionsMonitor<JwtBearerOptions>>().Get(JwtBearerDefaults.AuthenticationScheme);
Microsoft.AspNetCore.FunctionalTests (3)
WebApplicationFunctionalTests.cs (3)
32var factory = (ILoggerFactory)app.Services.GetService(typeof(ILoggerFactory)); 75var factory = (ILoggerFactory)app.Services.GetService(typeof(ILoggerFactory)); 127var factory = (ILoggerFactory)app.Services.GetService(typeof(ILoggerFactory));
Microsoft.AspNetCore.Identity.FunctionalTests (4)
MapIdentityApiTests.cs (4)
386var userManager = app.Services.GetRequiredService<UserManager<ApplicationUser>>(); 405var userManager = app.Services.GetRequiredService<UserManager<ApplicationUser>>(); 647await app.Services.GetRequiredService<IdentityDbContext>().Database.EnsureCreatedAsync(); 1310await app.Services.GetRequiredService<TContext>().Database.EnsureCreatedAsync();
Microsoft.AspNetCore.Mvc.FunctionalTests (8)
AntiforgeryMiddlewareTest.cs (8)
36var antiforgery = app.Services.GetRequiredService<IAntiforgery>(); 37var antiforgeryOptions = app.Services.GetRequiredService<IOptions<AntiforgeryOptions>>(); 120var antiforgery = app.Services.GetRequiredService<IAntiforgery>(); 121var antiforgeryOptions = app.Services.GetRequiredService<IOptions<AntiforgeryOptions>>(); 152var antiforgery = app.Services.GetRequiredService<IAntiforgery>(); 153var antiforgeryOptions = app.Services.GetRequiredService<IOptions<AntiforgeryOptions>>(); 184var antiforgery = app.Services.GetRequiredService<IAntiforgery>(); 185var antiforgeryOptions = app.Services.GetRequiredService<IOptions<AntiforgeryOptions>>();
Microsoft.AspNetCore.Tests (32)
WebApplicationTests.cs (32)
950var hostEnv = app.Services.GetRequiredService<IHostEnvironment>(); 951var webHostEnv = app.Services.GetRequiredService<IWebHostEnvironment>(); 992var hostEnv = app.Services.GetRequiredService<IHostEnvironment>(); 993var webHostEnv = app.Services.GetRequiredService<IWebHostEnvironment>(); 1060var hostEnv = app.Services.GetRequiredService<IHostEnvironment>(); 1061var webHostEnv = app.Services.GetRequiredService<IWebHostEnvironment>(); 1362var config = app.Services.GetRequiredService<IConfiguration>(); 1363var monitor = app.Services.GetRequiredService<IOptionsMonitor<HostFilteringOptions>>(); 1463var linkGenerator = app.Services.GetService(typeof(LinkGenerator)); 1478var env0 = app.Services.GetRequiredService<IHostEnvironment>(); 1480var env1 = app.Services.GetRequiredService<IServiceCollection>().BuildServiceProvider().GetRequiredService<IHostEnvironment>(); 1508var service0 = app.Services.GetRequiredService<IService>(); 1510var service1 = app.Services.GetRequiredService<IServiceCollection>().BuildServiceProvider().GetRequiredService<IService>(); 1558var hostLifetime0 = app.Services.GetRequiredService<IHostLifetime>(); 1559var childServiceProvider = app.Services.GetRequiredService<IServiceCollection>().BuildServiceProvider(); 1562var hostLifetimes0 = app.Services.GetServices<IHostLifetime>().ToArray(); 1596var endpointDataSource = app.Services.GetRequiredService<EndpointDataSource>(); 1630var logger = app.Services.GetRequiredService<ILogger<WebApplicationTests>>(); 1650var logger = app.Services.GetRequiredService<ILogger<WebApplicationTests>>(); 1762Assert.Single(app.Services.GetRequiredService<IEnumerable<IConfigureOptions<LoggerFactoryOptions>>>()); 1763Assert.Single(app.Services.GetRequiredService<IEnumerable<IWebHostEnvironment>>()); 1764Assert.Single(app.Services.GetRequiredService<IEnumerable<IOptionsChangeTokenSource<HostFilteringOptions>>>()); 1765Assert.Single(app.Services.GetRequiredService<IEnumerable<IServer>>()); 1874var ds = app.Services.GetRequiredService<EndpointDataSource>(); 1934var ds = app.Services.GetRequiredService<EndpointDataSource>(); 1989var ds = app.Services.GetRequiredService<EndpointDataSource>(); 2229var hostEnv = app.Services.GetRequiredService<Hosting.IWebHostEnvironment>(); 2255var hostEnv = app.Services.GetRequiredService<IHostEnvironment>(); 2256var webHostEnv = app.Services.GetRequiredService<IWebHostEnvironment>(); 2285var hostEnv = app.Services.GetRequiredService<IHostEnvironment>(); 2286var webHostEnv = app.Services.GetRequiredService<IWebHostEnvironment>(); 2532Assert.IsType<MyServiceProvider>(app.Services);
SqlServerEndToEnd.DbSetup (1)
Program.cs (1)
11using var scope = app.Services.CreateScope();
Stress.ApiService (1)
Program.cs (1)
27_ = app.Services.GetRequiredService<TestMetrics>();
WaitForSandbox.DbSetup (1)
Program.cs (1)
9using var scope = app.Services.CreateScope();