63 references to GetServices
Aspire.Hosting (1)
DistributedApplication.cs (1)
353var lifecycleHooks = _host.Services.GetServices<IDistributedApplicationLifecycleHook>();
Aspire.Hosting.Azure.Tests (1)
AzureBicepResourceTests.cs (1)
88var hooks = app.Services.GetServices<IDistributedApplicationLifecycleHook>();
Aspire.Hosting.Tests (3)
AddParameterTests.cs (1)
93Assert.Contains(app.Services.GetServices<IDistributedApplicationLifecycleHook>(), hook => hook.GetType().Name == "WriteParameterLogsHook");
DistributedApplicationBuilderTests.cs (1)
44var lifecycles = app.Services.GetServices<IDistributedApplicationLifecycleHook>();
DistributedApplicationTests.cs (1)
869var lifecycles = app.Services.GetServices<IDistributedApplicationLifecycleHook>();
InMemory.FunctionalTests (1)
TestTransport\TestServer.cs (1)
100sp.GetServices<IMultiplexedConnectionListenerFactory>(),
Microsoft.AspNetCore.Components (1)
RenderTree\Renderer.cs (1)
95: serviceProvider.GetServices<ICascadingValueSupplier>().ToArray();
Microsoft.AspNetCore.Components.Endpoints (1)
Rendering\EndpointHtmlRenderer.cs (1)
91var authStateListeners = httpContext.RequestServices.GetServices<IHostEnvironmentAuthenticationStateProvider>();
Microsoft.AspNetCore.Components.Server (2)
Circuits\CircuitFactory.cs (1)
93var circuitHandlers = components.Count == 0 ? [] : scope.ServiceProvider.GetServices<CircuitHandler>()
Circuits\CircuitHost.cs (1)
766_circuitHandlers = [.. _scope.ServiceProvider.GetServices<CircuitHandler>().OrderBy(h => h.Order)];
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (2)
DatabaseDeveloperPageExceptionFilter.cs (1)
59var registeredContexts = errorContext.HttpContext.RequestServices.GetServices<DbContextOptions>()
MigrationsEndPointMiddleware.cs (1)
110var registeredContexts = context.RequestServices.GetServices<DbContextOptions>()
Microsoft.AspNetCore.Grpc.Swagger (1)
GrpcSwaggerServiceExtensions.cs (1)
40var apiDescriptionProvider = serviceProvider.GetServices<IApiDescriptionProvider>();
Microsoft.AspNetCore.Hosting.Tests (3)
WebHostBuilderTests.cs (3)
164var services = host.Services.GetServices<IHostApplicationLifetime>(); 1301var filter = (MyStartupFilter)host.Services.GetServices<IStartupFilter>().FirstOrDefault(s => s is MyStartupFilter); 1378var service = host.Services.GetServices<IHostedService>().OfType<NonThrowingHostedService>().First();
Microsoft.AspNetCore.Mvc.ApiExplorer (2)
DependencyInjection\EndpointMethodInfoApiExplorerServiceCollectionExtensions.cs (1)
27sp.GetServices<IApiDescriptionProvider>(),
DependencyInjection\MvcApiExplorerMvcCoreBuilderExtensions.cs (1)
37sp.GetServices<IApiDescriptionProvider>(),
Microsoft.AspNetCore.Routing (1)
Matching\EndpointMetadataComparer.cs (1)
37_comparers = _services.GetServices<MatcherPolicy>()
Microsoft.AspNetCore.Server.IISIntegration.Tests (1)
IISExtensionTests.cs (1)
39var filters = server.Services.GetServices<IStartupFilter>()
Microsoft.AspNetCore.Server.Kestrel.Tests (3)
WebHostBuilderKestrelExtensionsTests.cs (3)
62var transportFactories = hostBuilder.Build().Services.GetServices<IConnectionListenerFactory>(); 85var factories = hostBuilder.Build().Services.GetServices<IConnectionListenerFactory>(); 93var factoriesReversed = hostBuilderReversed.Build().Services.GetServices<IConnectionListenerFactory>();
Microsoft.AspNetCore.Tests (2)
WebApplicationTests.cs (2)
1562var hostLifetimes0 = app.Services.GetServices<IHostLifetime>().ToArray(); 1563var hostLifetimes1 = childServiceProvider.GetServices<IHostLifetime>().ToArray();
Microsoft.Extensions.Caching.Hybrid (1)
Internal\DefaultHybridCache.cs (1)
88var factories = services.GetServices<IHybridCacheSerializerFactory>().ToArray();
Microsoft.Extensions.Diagnostics.HealthChecks.Tests (1)
HealthCheckPublisherHostedServiceTest.cs (1)
785return services.GetServices<IHostedService>().OfType<HealthCheckPublisherHostedService>().Single();
Microsoft.Extensions.Diagnostics.Probes.Tests (18)
KubernetesProbesExtensionsTests.cs (6)
36var hostedServices = host.Services.GetServices<IHostedService>().Where(service => service.GetType().Name == "TcpEndpointProbesService"); 37var configurations = host.Services.GetServices<IOptionsMonitor<TcpEndpointProbesOptions>>(); 80var hostedServices = host.Services.GetServices<IHostedService>().Where(service => service.GetType().Name == "TcpEndpointProbesService"); 81var configurations = host.Services.GetServices<IOptionsMonitor<TcpEndpointProbesOptions>>(); 108var hostedServices = host.Services.GetServices<IHostedService>().Where(service => service.GetType().Name == "TcpEndpointProbesService"); 109var configurations = host.Services.GetServices<IOptionsMonitor<TcpEndpointProbesOptions>>();
TcpEndpointProbesExtensionsTests.cs (12)
36var hostedServices = host.Services.GetServices<IHostedService>().Where(x => x is TcpEndpointProbesService); 55var hostedServices = host.Services.GetServices<IHostedService>().Where(x => x is TcpEndpointProbesService); 56var configurations = host.Services.GetServices<IOptions<TcpEndpointProbesOptions>>(); 73var hostedServices = host.Services.GetServices<IHostedService>().Where(x => x is TcpEndpointProbesService); 92var hostedServices = host.Services.GetServices<IHostedService>().Where(x => x is TcpEndpointProbesService); 93var configurations = host.Services.GetServices<IOptionsMonitor<TcpEndpointProbesOptions>>(); 118var hostedServices = host.Services.GetServices<IHostedService>().Where(x => x is TcpEndpointProbesService); 119var configurations = host.Services.GetServices<IOptions<TcpEndpointProbesOptions>>(); 143var hostedServices = host.Services.GetServices<IHostedService>().Where(x => x is TcpEndpointProbesService); 144var configurations = host.Services.GetServices<IOptionsMonitor<TcpEndpointProbesOptions>>(); 164var hostedServices = host.Services.GetServices<IHostedService>().Where(x => x is TcpEndpointProbesService); 165var configurations = host.Services.GetServices<IOptionsMonitor<TcpEndpointProbesOptions>>();
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (5)
ResourceMonitoringBuilderTests.cs (2)
25var publishersArray = provider.GetServices<IResourceUtilizationPublisher>(); 47var publishersArray = provider.GetServices<IResourceUtilizationPublisher>();
ResourceMonitoringExtensionsTests.cs (3)
80var allHostedServices = provider.GetServices<IHostedService>(); 196var trackers = host.Services.GetServices<IResourceMonitor>().ToArray(); 197var backgrounds = host.Services.GetServices<IHostedService>().Where(x => x is ResourceMonitorService).ToArray();
Microsoft.Extensions.Hosting.Testing.Tests (2)
FakeHostBuilderTests.cs (1)
39Assert.Contains(hostBuilderServices.GetServices<IHostedService>(), x => x is HostTerminatorService);
FakeHostTests.cs (1)
22Assert.Contains(host.Services.GetServices<ILoggerProvider>(), x => x is FakeLoggerProvider);
Microsoft.Extensions.Http.Diagnostics.Tests (4)
Logging\AcceptanceTests.cs (3)
50var enrichers = sp.GetServices<IHttpClientLogEnricher>().ToList(); 118var enricher1 = sp.GetServices<IHttpClientLogEnricher>().SingleOrDefault(enn => enn is EnricherWithCounter) as EnricherWithCounter; 119var enricher2 = sp.GetServices<IHttpClientLogEnricher>().SingleOrDefault(enn => enn is TestEnricher) as TestEnricher;
Logging\HttpClientLoggingExtensionsTest.cs (1)
410var loggers = serviceProvider.GetServices<T>();
Microsoft.Extensions.Telemetry.Abstractions.Tests (2)
Enrichment\EnricherExtensionsTests.cs (2)
41var enrichersCollection = provider.GetServices<ILogEnricher>(); 60var enrichersCollection = provider.GetServices<IStaticLogEnricher>();
Microsoft.ML.AutoML (1)
AutoMLExperiment\AutoMLExperiment.cs (1)
220var stopServices = serviceProvider.GetServices<IStopTrainingManager>();
Sockets.BindTests (2)
src\Servers\Kestrel\shared\test\TransportTestHelpers\TestServer.cs (2)
96var configureOptions = sp.GetServices<IConfigureOptions<KestrelServerOptions>>(); 102return new KestrelServerImpl(sp.GetServices<IConnectionListenerFactory>(), Array.Empty<IMultiplexedConnectionListenerFactory>(), sp.GetRequiredService<IHttpsConfigurationService>(), context);
Sockets.FunctionalTests (2)
src\Servers\Kestrel\shared\test\TransportTestHelpers\TestServer.cs (2)
96var configureOptions = sp.GetServices<IConfigureOptions<KestrelServerOptions>>(); 102return new KestrelServerImpl(sp.GetServices<IConnectionListenerFactory>(), Array.Empty<IMultiplexedConnectionListenerFactory>(), sp.GetRequiredService<IHttpsConfigurationService>(), context);