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