Implemented interface member:
property
Services
Microsoft.Extensions.Hosting.IHost.Services
65 references to Services
Aspire.Dashboard (8)
DashboardWebApplication.cs (8)
170_dashboardOptionsMonitor = _app.Services.GetRequiredService<IOptionsMonitor<DashboardOptions>>(); 173Services = _app.Services; 301_dashboardOptionsMonitor = _app.Services.GetRequiredService<IOptionsMonitor<DashboardOptions>>(); 303Services = _app.Services; 324var corsOptions = _app.Services.GetRequiredService<IOptions<CorsOptions>>().Value; 360var options = _app.Services.GetRequiredService<IOptionsMonitor<DashboardOptions>>().CurrentValue; 372var telemetryService = _app.Services.GetRequiredService<DashboardTelemetryService>(); 473return _app.Services.GetRequiredService<ILoggerFactory>().CreateLogger<DashboardWebApplication>();
Aspire.Hosting (1)
Dashboard\DashboardServiceHost.cs (1)
207var addressFeature = _app.Services.GetService<IServer>()?.Features.Get<IServerAddressesFeature>();
Microsoft.AspNetCore (4)
WebApplication.cs (3)
88IServiceProvider IEndpointRouteBuilder.ServiceProvider => Services; 265public IServiceProvider Services => _webApplication.Services; 275var dataSource = _webApplication.Services.GetRequiredService<EndpointDataSource>();
WebApplicationBuilder.cs (1)
434var serviceProviderIsService = _builtApplication.Services.GetService<IServiceProviderIsService>();
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)
952var hostEnv = app.Services.GetRequiredService<IHostEnvironment>(); 953var webHostEnv = app.Services.GetRequiredService<IWebHostEnvironment>(); 994var hostEnv = app.Services.GetRequiredService<IHostEnvironment>(); 995var webHostEnv = app.Services.GetRequiredService<IWebHostEnvironment>(); 1062var hostEnv = app.Services.GetRequiredService<IHostEnvironment>(); 1063var webHostEnv = app.Services.GetRequiredService<IWebHostEnvironment>(); 1364var config = app.Services.GetRequiredService<IConfiguration>(); 1365var monitor = app.Services.GetRequiredService<IOptionsMonitor<HostFilteringOptions>>(); 1465var linkGenerator = app.Services.GetService(typeof(LinkGenerator)); 1480var env0 = app.Services.GetRequiredService<IHostEnvironment>(); 1482var env1 = app.Services.GetRequiredService<IServiceCollection>().BuildServiceProvider().GetRequiredService<IHostEnvironment>(); 1510var service0 = app.Services.GetRequiredService<IService>(); 1512var service1 = app.Services.GetRequiredService<IServiceCollection>().BuildServiceProvider().GetRequiredService<IService>(); 1560var hostLifetime0 = app.Services.GetRequiredService<IHostLifetime>(); 1561var childServiceProvider = app.Services.GetRequiredService<IServiceCollection>().BuildServiceProvider(); 1564var hostLifetimes0 = app.Services.GetServices<IHostLifetime>().ToArray(); 1598var endpointDataSource = app.Services.GetRequiredService<EndpointDataSource>(); 1632var logger = app.Services.GetRequiredService<ILogger<WebApplicationTests>>(); 1652var logger = app.Services.GetRequiredService<ILogger<WebApplicationTests>>(); 1764Assert.Single(app.Services.GetRequiredService<IEnumerable<IConfigureOptions<LoggerFactoryOptions>>>()); 1765Assert.Single(app.Services.GetRequiredService<IEnumerable<IWebHostEnvironment>>()); 1766Assert.Single(app.Services.GetRequiredService<IEnumerable<IOptionsChangeTokenSource<HostFilteringOptions>>>()); 1767Assert.Single(app.Services.GetRequiredService<IEnumerable<IServer>>()); 1876var ds = app.Services.GetRequiredService<EndpointDataSource>(); 1936var ds = app.Services.GetRequiredService<EndpointDataSource>(); 1991var ds = app.Services.GetRequiredService<EndpointDataSource>(); 2231var hostEnv = app.Services.GetRequiredService<Hosting.IWebHostEnvironment>(); 2257var hostEnv = app.Services.GetRequiredService<IHostEnvironment>(); 2258var webHostEnv = app.Services.GetRequiredService<IWebHostEnvironment>(); 2287var hostEnv = app.Services.GetRequiredService<IHostEnvironment>(); 2288var webHostEnv = app.Services.GetRequiredService<IWebHostEnvironment>(); 2534Assert.IsType<MyServiceProvider>(app.Services);
Publishers.DbSetup (1)
Program.cs (1)
9using var scope = app.Services.CreateScope();
SqlServerEndToEnd.DbSetup (1)
Program.cs (1)
11using var scope = app.Services.CreateScope();
Stress.ApiService (1)
Program.cs (1)
41_ = app.Services.GetRequiredService<TestMetrics>();
WaitForSandbox.DbSetup (1)
Program.cs (1)
9using var scope = app.Services.CreateScope();