436 references to GetService
BasicTestApp (2)
Program.cs (2)
51new PrependMessageLoggerProvider(builder.Configuration["Logging:PrependMessage:Message"], s.GetService<IJSRuntime>())); 67uri = new Uri(host.Services.GetService<NavigationManager>().Uri);
BasicWebSite (1)
RequestIdMiddleware.cs (1)
18var requestIdService = context.RequestServices.GetService<RequestIdService>();
DatabaseErrorPageSample (1)
Startup.cs (1)
24context.RequestServices.GetService<MyContext>().Blog.FirstOrDefault();
DependencyInjectionApp (1)
Program.cs (1)
30context.RequestServices.GetService<IService<IAnotherService>>();
Diagnostics.EFCore.FunctionalTests (11)
DatabaseErrorPageMiddlewareTest.cs (11)
119var db = context.RequestServices.GetService<BloggingContext>(); 157var db = context.RequestServices.GetService<BloggingContext>(); 173using (var db = server.Services.GetService<BloggingContext>()) 222var db = context.RequestServices.GetService<BloggingContextWithMigrations>(); 260var db = context.RequestServices.GetService<BloggingContextWithPendingModelChanges>(); 318var db = context.RequestServices.GetService<BloggingContextWithMigrations>(); 389app.ApplicationServices.GetService<ILoggerFactory>().AddProvider(logProvider); 422.UseLoggerFactory(context.RequestServices.GetService<ILoggerFactory>()) 468var db = context.RequestServices.GetService<BloggingContextWithSnapshotThatThrows>(); 502var db = context.RequestServices.GetService<BloggingContext>(); 535app.ApplicationServices.GetService<ILoggerFactory>().AddProvider(logProvider);
IIS.Tests (1)
Utilities\TestServer.cs (1)
166var lifetime = _host.Services.GetService<IHostApplicationLifetime>();
InProcessWebSite (12)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (12)
57private async Task ContentRootPath(HttpContext ctx) => await ctx.Response.WriteAsync(ctx.RequestServices.GetService<Microsoft.AspNetCore.Hosting.IHostingEnvironment>().ContentRootPath); 59private async Task WebRootPath(HttpContext ctx) => await ctx.Response.WriteAsync(ctx.RequestServices.GetService<Microsoft.AspNetCore.Hosting.IHostingEnvironment>().WebRootPath); 72var config = ctx.RequestServices.GetService<IConfiguration>(); 106var serverAddresses = ctx.RequestServices.GetService<IServer>().Features.Get<IServerAddressesFeature>(); 131var authProvider = ctx.RequestServices.GetService<IAuthenticationSchemeProvider>(); 177var hostingEnv = context.RequestServices.GetService<Microsoft.AspNetCore.Hosting.IHostingEnvironment>(); 599var lifetime = ctx.RequestServices.GetService<Microsoft.AspNetCore.Hosting.IApplicationLifetime>(); 995ctx.RequestServices.GetService<Microsoft.AspNetCore.Hosting.IApplicationLifetime>().StopApplication(); 1004var server = ctx.RequestServices.GetService<IServer>(); 1011var server = ctx.RequestServices.GetService<IServer>(); 1132var httpsPort = context.RequestServices.GetService<IConfiguration>().GetValue<int?>("ANCM_HTTPS_PORT"); 1139var httpsPort = context.RequestServices.GetService<IConfiguration>().GetValue<int?>("HTTPS_PORT");
KeyManagementSample (1)
Program.cs (1)
34var keyManager = services.GetService<IKeyManager>();
Microsoft.AspNetCore.Authentication.Abstractions (1)
AuthenticationHttpContextExtensions.cs (1)
217context.RequestServices.GetService<IAuthenticationService>() ??
Microsoft.AspNetCore.Authentication.BearerToken (1)
BearerTokenHandler.cs (1)
86var typeInfo = httpContext.RequestServices.GetService<IOptions<JsonOptions>>()
Microsoft.AspNetCore.Authentication.Certificate (1)
CertificateAuthenticationHandler.cs (1)
44_cache = Context.RequestServices.GetService<ICertificateValidationCache>();
Microsoft.AspNetCore.Authentication.Test (1)
AuthenticationMiddlewareTests.cs (1)
179var options = app.Services.GetService<IOptionsMonitor<JwtBearerOptions>>().Get(JwtBearerDefaults.AuthenticationScheme);
Microsoft.AspNetCore.Authorization.Policy (1)
AuthorizationMiddleware.cs (1)
84_policyCache = services.GetService<AuthorizationPolicyCache>();
Microsoft.AspNetCore.Components (3)
RenderTree\Renderer.cs (2)
93ServiceProviderCascadingValueSuppliers = serviceProvider.GetService<ICascadingValueSupplier>() is null 104return serviceProvider.GetService<IComponentActivator>()
Routing\Router.cs (1)
108RoutingStateProvider = ServiceProvider.GetService<IRoutingStateProvider>();
Microsoft.AspNetCore.Components.Endpoints (5)
Builder\OpaqueRedirection.cs (1)
69if (httpContext.RequestServices.GetService<ILogger<OpaqueRedirection>>() is { } logger)
Builder\RazorComponentsEndpointRouteBuilderExtensions.cs (1)
89var marker = endpoints.ServiceProvider.GetService<RazorComponentsMarkerService>();
Rendering\EndpointHtmlRenderer.cs (2)
81var authenticationStateProvider = httpContext.RequestServices.GetService<AuthenticationStateProvider>(); 105if (httpContext.RequestServices.GetService<AntiforgeryStateProvider>() is EndpointAntiforgeryStateProvider antiforgery)
Rendering\EndpointHtmlRenderer.EventDispatch.cs (1)
72return _httpContext.RequestServices.GetService<IHostEnvironment>()?.IsDevelopment() == true
Microsoft.AspNetCore.Components.Endpoints.Tests (1)
RazorComponentEndpointDataSourceTest.cs (1)
230services?.GetService<IEnumerable<RenderModeEndpointProvider>>() ?? Enumerable.Empty<RenderModeEndpointProvider>(),
Microsoft.AspNetCore.Components.QuickGrid (1)
Infrastructure\AsyncQueryExecutorSupplier.cs (1)
32var executor = services.GetService<IAsyncQueryExecutor>();
Microsoft.AspNetCore.Components.Server (1)
Circuits\CircuitHost.cs (1)
599var authenticationStateProvider = Services.GetService<AuthenticationStateProvider>() as IHostEnvironmentAuthenticationStateProvider;
Microsoft.AspNetCore.Components.Web (4)
Forms\AntiforgeryToken.cs (1)
23_requestToken = Services.GetService<AntiforgeryStateProvider>()?.GetAntiforgeryToken();
HtmlRendering\StaticHtmlRenderer.cs (3)
35_navigationManager = serviceProvider.GetService<NavigationManager>(); 36_htmlEncoder = serviceProvider.GetService<HtmlEncoder>() ?? HtmlEncoder.Default; 37_javaScriptEncoder = serviceProvider.GetService<JavaScriptEncoder>() ?? JavaScriptEncoder.Default;
Microsoft.AspNetCore.DataProtection (13)
ActivatorExtensions.cs (1)
38? (serviceProvider.GetService<IActivator>() ?? new SimpleActivator(serviceProvider))
DataProtectionBuilderExtensions.cs (6)
175var loggerFactory = services.GetService<ILoggerFactory>() ?? NullLoggerFactory.Instance; 199var loggerFactory = services.GetService<ILoggerFactory>() ?? NullLoggerFactory.Instance; 222var loggerFactory = services.GetService<ILoggerFactory>() ?? NullLoggerFactory.Instance; 257var loggerFactory = services.GetService<ILoggerFactory>() ?? NullLoggerFactory.Instance; 328var loggerFactory = services.GetService<ILoggerFactory>() ?? NullLoggerFactory.Instance; 382var loggerFactory = services.GetService<ILoggerFactory>() ?? NullLoggerFactory.Instance;
DataProtectionServiceCollectionExtensions.cs (1)
87var loggerFactory = s.GetService<ILoggerFactory>() ?? NullLoggerFactory.Instance;
DataProtectionUtilityExtensions.cs (1)
41discriminator = services.GetService<IApplicationDiscriminator>()?.Discriminator;
KeyManagement\KeyEscrowServiceProviderExtensions.cs (1)
20var escrowSinks = services?.GetService<IEnumerable<IKeyEscrowSink>>()?.ToList();
LoggingServiceProviderExtensions.cs (1)
40return services?.GetService<ILoggerFactory>()?.CreateLogger(type.FullName!) ?? NullLogger.Instance;
XmlEncryption\EncryptedXmlDecryptor.cs (2)
39_decryptor = services?.GetService<IInternalEncryptedXmlDecryptor>() ?? this; 40_options = services?.GetService<IOptions<XmlKeyDecryptionOptions>>()?.Value;
Microsoft.AspNetCore.DataProtection.EntityFrameworkCore (1)
EntityFrameworkCoreDataProtectionExtensions.cs (1)
29var loggerFactory = services.GetService<ILoggerFactory>() ?? NullLoggerFactory.Instance;
Microsoft.AspNetCore.DataProtection.Tests (2)
ServiceCollectionTests.cs (2)
26Assert.NotNull(services.GetService<IOptions<DataProtectionOptions>>()); 57Assert.Null(services.GetService<ILoggerFactory>());
Microsoft.AspNetCore.Diagnostics (2)
ExceptionHandler\ExceptionHandlerExtensions.cs (1)
109var problemDetailsService = app.ApplicationServices.GetService<IProblemDetailsService>();
StatusCodePage\StatusCodePagesOptions.cs (1)
26var problemDetailsService = context.HttpContext.RequestServices.GetService<IProblemDetailsService>();
Microsoft.AspNetCore.Grpc.Swagger (2)
GrpcSwaggerServiceExtensions.cs (2)
39var actionDescriptorCollectionProvider = serviceProvider.GetService<IActionDescriptorCollectionProvider>(); 50var serializerOptions = s.GetService<IOptions<JsonOptions>>()?.Value?.JsonSerializerOptions ?? new JsonSerializerOptions();
Microsoft.AspNetCore.HeaderPropagation (1)
DependencyInjection\HeaderPropagationApplicationBuilderExtensions.cs (1)
31if (app.ApplicationServices.GetService<HeaderPropagationValues>() == null)
Microsoft.AspNetCore.Hosting (11)
Http\DefaultHttpContextFactory.cs (1)
32_httpContextAccessor = serviceProvider.GetService<IHttpContextAccessor>();
Internal\WebHost.cs (5)
67=> services.GetService<ApplicationLifetime>()!); 70=> services.GetService<ApplicationLifetime>()!); 72=> services.GetService<ApplicationLifetime>()!); 189var startup = _hostingServiceProvider.GetService<IStartup>(); 213var startupFilters = _applicationServices.GetService<IEnumerable<IStartupFilter>>();
WebHostBuilder.cs (4)
174_ = host.Services.GetService<IConfiguration>(); 201var factory = provider.GetService<IServiceProviderFactory<IServiceCollection>>(); 354var listener = hostingServiceProvider.GetService<DiagnosticListener>(); 358var activitySource = hostingServiceProvider.GetService<ActivitySource>();
WebHostExtensions.cs (1)
114var hostingEnvironment = host.Services.GetService<IHostEnvironment>();
Microsoft.AspNetCore.Hosting.Tests (42)
WebHostBuilderTests.cs (26)
208Assert.NotNull(host.Services.GetService<ILoggerFactory>()); 369Assert.NotNull(host.Services.GetService<IConfiguration>()); 410var config = host.Services.GetService<IConfiguration>(); 611Assert.Equal(expected, host.Services.GetService<IHostEnvironment>().EnvironmentName); 612Assert.Equal(expected, host.Services.GetService<IWebHostEnvironment>().EnvironmentName); 614Assert.Equal(expected, host.Services.GetService<AspNetCore.Hosting.IHostingEnvironment>().EnvironmentName); 615Assert.Equal(expected, host.Services.GetService<Extensions.Hosting.IHostingEnvironment>().EnvironmentName); 659Assert.Equal("/", host.Services.GetService<IHostEnvironment>().ContentRootPath); 660Assert.Equal("/", host.Services.GetService<IWebHostEnvironment>().ContentRootPath); 662Assert.Equal("/", host.Services.GetService<AspNetCore.Hosting.IHostingEnvironment>().ContentRootPath); 663Assert.Equal("/", host.Services.GetService<Extensions.Hosting.IHostingEnvironment>().ContentRootPath); 680var basePath2 = host.Services.GetService<AspNetCore.Hosting.IHostingEnvironment>().ContentRootPath; 701Assert.Equal(appBase, host.Services.GetService<IHostEnvironment>().ContentRootPath); 703Assert.Equal(appBase, host.Services.GetService<AspNetCore.Hosting.IHostingEnvironment>().ContentRootPath); 732var hostingEnv = host.Services.GetService<IHostEnvironment>(); 734var hostingEnv2 = host.Services.GetService<AspNetCore.Hosting.IHostingEnvironment>(); 750var hostingEnv = host.Services.GetService<IHostEnvironment>(); 752var hostingEnv2 = host.Services.GetService<AspNetCore.Hosting.IHostingEnvironment>(); 768var hostingEnv = host.Services.GetService<IHostEnvironment>(); 781var hostingEnv = host.Services.GetService<IHostEnvironment>(); 797var hostingEnv = host.Services.GetService<IHostEnvironment>(); 813var hostingEnv = host.Services.GetService<IHostEnvironment>(); 827var hostingEnv = host.Services.GetService<IHostEnvironment>(); 879var factoryFromHost = host.Services.GetService<ILoggerFactory>(); 1067var loggerFactory = app.ApplicationServices.GetService<ILoggerFactory>(); 1658ServiceA = app.ApplicationServices.GetService<ServiceA>();
WebHostTests.cs (16)
384var singleton = (FakeService)host.Services.GetService<IFakeSingletonService>(); 385var transient = (FakeService)host.Services.GetService<IFakeService>(); 409var applicationLifetime = host.Services.GetService<IHostApplicationLifetime>(); 411var applicationLifetime2 = host.Services.GetService<AspNetCore.Hosting.IApplicationLifetime>(); 430var applicationLifetime = host.Services.GetService<IHostApplicationLifetime>(); 432var applicationLifetime2 = host.Services.GetService<AspNetCore.Hosting.IApplicationLifetime>(); 680var applicationLifetime = host.Services.GetService<IHostApplicationLifetime>(); 682var applicationLifetime2 = host.Services.GetService<AspNetCore.Hosting.IApplicationLifetime>(); 714var env = host.Services.GetService<IHostEnvironment>(); 716var env2 = host.Services.GetService<AspNetCore.Hosting.IHostingEnvironment>(); 801var env = host.Services.GetService<IHostEnvironment>(); 803var env2 = host.Services.GetService<AspNetCore.Hosting.IHostingEnvironment>(); 824var env = host.Services.GetService<IHostEnvironment>(); 826var env2 = host.Services.GetService<AspNetCore.Hosting.IHostingEnvironment>(); 847var env = host.Services.GetService<IWebHostEnvironment>(); 852var env1 = host.Services.GetService<IHostingEnvironment>();
Microsoft.AspNetCore.Http (2)
Internal\ResponseCookies.cs (2)
54_logger = services?.GetService<ILogger<ResponseCookies>>(); 78_logger = services?.GetService<ILogger<ResponseCookies>>();
Microsoft.AspNetCore.Http.Connections.Tests (7)
HttpConnectionDispatcherTests.cs (6)
3252var url = host.Services.GetService<IServer>().Features.Get<IServerAddressesFeature>().Addresses.Single(); 3315var url = host.Services.GetService<IServer>().Features.Get<IServerAddressesFeature>().Addresses.Single(); 3414var url = host.Services.GetService<IServer>().Features.Get<IServerAddressesFeature>().Addresses.Single(); 3464var url = host.Services.GetService<IServer>().Features.Get<IServerAddressesFeature>().Addresses.Single(); 3538var url = host.Services.GetService<IServer>().Features.Get<IServerAddressesFeature>().Addresses.Single(); 3917var message = context.RequestServices.GetService<MessageWrapper>();
MapConnectionHandlerTests.cs (1)
396var feature = host.Services.GetService<IServer>().Features.Get<IServerAddressesFeature>();
Microsoft.AspNetCore.Http.Extensions (4)
HttpRequestJsonExtensions.cs (1)
306return httpContext.RequestServices?.GetService<IOptions<JsonOptions>>()?.Value?.SerializerOptions ?? JsonOptions.DefaultSerializerOptions;
HttpResponseJsonExtensions.cs (1)
340return httpContext.RequestServices?.GetService<IOptions<JsonOptions>>()?.Value?.SerializerOptions ?? JsonOptions.DefaultSerializerOptions;
RequestDelegateFactory.cs (2)
278var jsonSerializerOptions = serviceProvider.GetService<IOptions<JsonOptions>>()?.Value.SerializerOptions ?? JsonOptions.DefaultSerializerOptions; 285ServiceProviderIsService = serviceProvider.GetService<IServiceProviderIsService>(),
Microsoft.AspNetCore.Http.Extensions.Tests (6)
ProblemDetailsServiceCollectionExtensionsTest.cs (6)
98var jsonOptions = services.GetService<IOptions<JsonOptions>>(); 123var jsonOptions = services.GetService<IOptions<JsonOptions>>(); 163var jsonOptions = services.GetService<IOptions<JsonOptions>>(); 184var jsonOptions = services.GetService<IOptions<JsonOptions>>(); 204var jsonOptions = services.GetService<IOptions<JsonOptions>>(); 229var jsonOptions = services.GetService<IOptions<JsonOptions>>();
Microsoft.AspNetCore.Http.Results (2)
HttpResultsHelper.cs (1)
154return httpContext.RequestServices.GetService<IOptions<JsonOptions>>()?.Value ?? new JsonOptions();
ProblemHttpResult.cs (1)
55var problemDetailsService = httpContext.RequestServices.GetService<IProblemDetailsService>();
Microsoft.AspNetCore.Http.Tests (1)
DefaultHttpContextTests.cs (1)
538var scope = new AsyncServiceScope(_serviceProvider.GetService<IServiceScopeFactory>().CreateScope());
Microsoft.AspNetCore.HttpLogging (2)
HttpLoggingBuilderExtensions.cs (2)
48var serviceProviderIsService = app.ApplicationServices.GetService<IServiceProviderIsService>(); 60var serviceProviderIsService = app.ApplicationServices.GetService<IServiceProviderIsService>();
Microsoft.AspNetCore.Identity (1)
AspNetUserManager.cs (1)
42_cancel = services?.GetService<IHttpContextAccessor>()?.HttpContext?.RequestAborted ?? CancellationToken.None;
Microsoft.AspNetCore.Identity.EntityFrameworkCore (1)
IdentityUserContext.cs (1)
106?.GetService<IOptions<IdentityOptions>>()
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (1)
UserStoreEncryptPersonalDataTest.cs (1)
199var manager = scope.ServiceProvider.GetService<UserManager<CustomUser>>();
Microsoft.AspNetCore.Identity.FunctionalTests (1)
Infrastructure\ServerFactory.cs (1)
77scope.ServiceProvider.GetService<TContext>()?.Database?.EnsureCreated();
Microsoft.AspNetCore.Identity.Specification.Tests (2)
IdentitySpecificationTestBase.cs (1)
91return services.BuildServiceProvider().GetService<RoleManager<TRole>>();
UserManagerSpecificationTests.cs (1)
90return services.BuildServiceProvider().GetService<UserManager<TUser>>();
Microsoft.AspNetCore.Identity.Test (8)
IdentityBuilderTest.cs (4)
49Assert.Null(sp.GetService<IRoleStore<PocoRole>>()); 50Assert.Throws<InvalidOperationException>(() => sp.GetService<RoleManager<PocoRole>>()); 215Assert.NotNull(provider.GetService<IOptions<SecurityStampValidatorOptions>>()); 235Assert.NotNull(provider.GetService<IOptions<SecurityStampValidatorOptions>>());
UserManagerTest.cs (4)
800var manager = services.BuildServiceProvider().GetService<UserManager<PocoUser>>(); 811var e = Assert.Throws<InvalidOperationException>(() => services.BuildServiceProvider().GetService<UserManager<PocoUser>>()); 822var e = Assert.Throws<InvalidOperationException>(() => services.BuildServiceProvider().GetService<UserManager<PocoUser>>()); 897var manager = services.BuildServiceProvider().GetService<UserManager<PocoUser>>();
Microsoft.AspNetCore.Mvc.Core (5)
ApplicationModels\ApiBehaviorApplicationModelProvider.cs (1)
49var serviceProviderIsService = serviceProvider.GetService<IServiceProviderIsService>();
Builder\ControllerEndpointRouteBuilderExtensions.cs (1)
500var marker = endpoints.ServiceProvider.GetService<MvcMarkerService>();
Formatters\TextOutputFormatter.cs (1)
133if (context.HttpContext.RequestServices.GetService<IProblemDetailsService>() is { } problemDetailsService)
Infrastructure\ObjectResultExecutor.cs (1)
104if (context.HttpContext.RequestServices.GetService<IProblemDetailsService>() is { } problemDetailsService)
ModelBinding\DefaultModelBindingContext.cs (1)
235var mvcOptions = actionContext.HttpContext.RequestServices?.GetService<IOptions<MvcOptions>>();
Microsoft.AspNetCore.Mvc.Core.Test (1)
ModelBinding\Validation\DefaultObjectValidatorTests.cs (1)
599var receivedService = context.GetService<IExampleService>();
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (1)
DataAnnotationsModelValidatorTest.cs (1)
412var receivedService = context.GetService<IExampleService>();
Microsoft.AspNetCore.Mvc.IntegrationTests (2)
ParameterBinderExtensions.cs (2)
21var optionsAccessor = context.HttpContext.RequestServices.GetService<IOptions<MvcOptions>>(); 23var modelMetadataProvider = context.HttpContext.RequestServices.GetService<IModelMetadataProvider>();
Microsoft.AspNetCore.Mvc.Razor (1)
DefaultTagHelperFactory.cs (1)
76var initializers = serviceProvider.GetService<IEnumerable<ITagHelperInitializer<TTagHelper>>>()!;
Microsoft.AspNetCore.Mvc.RazorPages (1)
Builder\RazorPagesEndpointRouteBuilderExtensions.cs (1)
357var marker = endpoints.ServiceProvider.GetService<PageActionEndpointDataSourceFactory>();
Microsoft.AspNetCore.Mvc.ViewFeatures (4)
PartialViewResult.cs (1)
65var executor = services.GetService<IActionResultExecutor<PartialViewResult>>();
RemoteAttributeBase.cs (1)
181var factory = services.GetService<IStringLocalizerFactory>();
ViewComponentResult.cs (1)
64var executor = services.GetService<IActionResultExecutor<ViewComponentResult>>();
ViewResult.cs (1)
64var executor = context.HttpContext.RequestServices.GetService<IActionResultExecutor<ViewResult>>();
Microsoft.AspNetCore.OpenApi (2)
Extensions\OpenApiEndpointConventionBuilderExtensions.cs (2)
106var hostEnvironment = applicationServices.GetService<IHostEnvironment>(); 107var serviceProviderIsService = applicationServices.GetService<IServiceProviderIsService>();
Microsoft.AspNetCore.Owin.Tests (4)
OwinExtensionTests.cs (4)
37fakeService = context.RequestServices.GetService<FakeService>(); 49Assert.NotNull(serviceProvider.GetService<FakeService>()); 71fakeService = context.RequestServices.GetService<FakeService>(); 105fakeService = context.RequestServices.GetService<FakeService>();
Microsoft.AspNetCore.RateLimiting (1)
RateLimiterApplicationBuilderExtensions.cs (1)
48var serviceProviderIsService = app.ApplicationServices.GetService<IServiceProviderIsService>();
Microsoft.AspNetCore.Routing (2)
Builder\EndpointRouteBuilderExtensions.cs (1)
458var routeHandlerOptions = endpoints.ServiceProvider?.GetService<IOptions<RouteHandlerOptions>>();
RequestDelegateFilterPipelineBuilder.cs (1)
22var jsonOptions = serviceProvider?.GetService<IOptions<JsonOptions>>()?.Value ?? new JsonOptions();
Microsoft.AspNetCore.Routing.FunctionalTests (2)
Benchmarks\EndpointRoutingBenchmarkTest.cs (1)
28var configuration = _host.Services.GetService<IConfiguration>();
Benchmarks\RouterBenchmarkTest.cs (1)
29var configuration = _host.Services.GetService<IConfiguration>();
Microsoft.AspNetCore.Routing.Tests (1)
RoutingServiceCollectionExtensionsTests.cs (1)
79var options = provider.GetService<IOptions<RouteOptions>>();
Microsoft.AspNetCore.Server.IIS (1)
Core\IISServerSetupFilter.cs (1)
17var server = app.ApplicationServices.GetService<IServer>();
Microsoft.AspNetCore.Server.IISIntegration.Tests (3)
IISMiddlewareTests.cs (3)
320var configuration = host.Services.GetService<IConfiguration>(); 349var configuration = host.Services.GetService<IConfiguration>(); 450var auth = context.RequestServices.GetService<IAuthenticationSchemeProvider>();
Microsoft.AspNetCore.Server.Kestrel.Tests (1)
WebHostBuilderKestrelExtensionsTests.cs (1)
110Assert.IsType<KestrelServerImpl>(hostBuilder.Build().Services.GetService<IServer>());
Microsoft.AspNetCore.SignalR (1)
HubEndpointRouteBuilderExtensions.cs (1)
41var marker = endpoints.ServiceProvider.GetService<SignalRMarkerService>();
Microsoft.AspNetCore.SignalR.Client.Core (4)
HubConnection.cs (2)
238var options = serviceProvider.GetService<IOptions<HubConnectionOptions>>(); 1985_hubConnection._serviceProvider.GetService<IOptions<HubConnectionOptions>>()?.Value.StatefulReconnectBufferSize
HubConnectionBuilder.cs (2)
49var connectionFactory = serviceProvider.GetService<IConnectionFactory>() ?? 52var endPoint = serviceProvider.GetService<EndPoint>() ??
Microsoft.AspNetCore.SignalR.Client.Tests (11)
HubConnectionBuilderExtensionsTests.cs (8)
27var value = serviceProvider.GetService<IOptions<HttpConnectionOptions>>().Value; 40var value = serviceProvider.GetService<IOptions<HttpConnectionOptions>>().Value; 54var value = serviceProvider.GetService<IOptions<HttpConnectionOptions>>().Value; 70var value = serviceProvider.GetService<IOptions<HttpConnectionOptions>>().Value; 85var value = serviceProvider.GetService<IOptions<HttpConnectionOptions>>().Value; 96var loggerFactory = serviceProvider.GetService<ILoggerFactory>(); 108var resolvedHubProtocol = serviceProvider.GetService<IHubProtocol>(); 121var resolvedHubProtocol = serviceProvider.GetService<IHubProtocol>();
HubConnectionBuilderTests.cs (3)
41var actualProtocol = Assert.IsType<NewtonsoftJsonHubProtocol>(serviceProvider.GetService<IHubProtocol>()); 56var actualProtocol = Assert.IsType<NewtonsoftJsonHubProtocol>(serviceProvider.GetService<IHubProtocol>()); 78Assert.IsType<MessagePackHubProtocol>(serviceProvider.GetService<IHubProtocol>());
Microsoft.AspNetCore.SignalR.Core (3)
Internal\DefaultHubActivator.cs (1)
26var hub = _serviceProvider.GetService<THub>();
Internal\DefaultHubDispatcher.cs (2)
745serviceProviderIsService = scope.ServiceProvider.GetService<IServiceProviderIsService>(); 796if (serviceProvider.GetService<SignalRActivitySource>() is SignalRActivitySource signalRActivitySource
Microsoft.AspNetCore.SignalR.Microbenchmarks (1)
DefaultHubDispatcherBenchmark.cs (1)
30var serviceScopeFactory = provider.GetService<IServiceScopeFactory>();
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (1)
RedisDependencyInjectionExtensionsTests.cs (1)
27var options = provider.GetService<IOptions<RedisOptions>>();
Microsoft.AspNetCore.SignalR.Tests (171)
HubConnectionHandlerTests.Activity.cs (6)
47var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 118var connectionHandler = serviceProvider.GetService<HubConnectionHandler<StreamingHub>>(); 183var connectionHandler = serviceProvider.GetService<HubConnectionHandler<OnConnectedThrowsHub>>(); 230var connectionHandler = serviceProvider.GetService<HubConnectionHandler<OnDisconnectedThrowsHub>>(); 281var connectionHandler = serviceProvider.GetService<HubConnectionHandler<StreamingHub>>(); 331var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>();
HubConnectionHandlerTests.ClientResult.cs (13)
19var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 52var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 84var connectionHandler = serviceProvider.GetService<HubConnectionHandler<OnConnectedClientResultHub>>(); 111var connectionHandler = serviceProvider.GetService<HubConnectionHandler<OnDisconnectedClientResultHub>>(); 136var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 168var connectionHandler = serviceProvider.GetService<HubConnectionHandler<HubT>>(); 202var connectionHandler = serviceProvider.GetService<HubConnectionHandler<HubT>>(); 237var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 291var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 360var connectionHandler = serviceProvider.GetService<HubConnectionHandler<HubT>>(); 405var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 450var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 487var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>();
HubConnectionHandlerTests.cs (134)
45var connectionHandler = serviceProvider.GetService<HubConnectionHandler<DisposeTrackingHub>>(); 73var connectionHandler = serviceProvider.GetService<HubConnectionHandler<HubWithAsyncDisposable>>(); 99var connectionHandler = serviceProvider.GetService<HubConnectionHandler<ConnectionLifetimeHub>>(); 123var connectionHandler = serviceProvider.GetService<HubConnectionHandler<ErrorInAbortedTokenHub>>(); 149var connectionHandler = serviceProvider.GetService<HubConnectionHandler<AbortHub>>(); 173var connectionHandler = serviceProvider.GetService<HubConnectionHandler<SimpleHub>>(); 201var connectionHandler = serviceProvider.GetService<HubConnectionHandler<SimpleHub>>(); 704var connectionHandler = serviceProvider.GetService<HubConnectionHandler<Hub>>(); 745var connectionHandler = serviceProvider.GetService<HubConnectionHandler<OnConnectedThrowsHub>>(); 777var connectionHandler = serviceProvider.GetService<HubConnectionHandler<OnDisconnectedThrowsHub>>(); 800var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 826var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 852var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 922var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 991var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 1016var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 1045var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 1070var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 1096var connectionHandler = serviceProvider.GetService<HubConnectionHandler<InheritedHub>>(); 1131var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 1159var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 1184var connectionHandler = serviceProvider.GetService<HubConnectionHandler<InheritedHub>>(); 1209var connectionHandler = serviceProvider.GetService<HubConnectionHandler<InheritedHub>>(); 1234var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 1261var connectionHandler = serviceProvider.GetService<HubConnectionHandler<InvalidHub>>(); 1278var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 1303var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 1336var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 1361var exception = Assert.Throws<NotSupportedException>(() => serviceProvider.GetService<HubConnectionHandler<GenericMethodHub>>()); 1411var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 1884var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 2010var connectionHandler = serviceProvider.GetService<HubConnectionHandler<StreamingHub>>(); 2045var connectionHandler = serviceProvider.GetService<HubConnectionHandler<StreamingHub>>(); 2094var connectionHandler = serviceProvider.GetService<HubConnectionHandler<StreamingHub>>(); 2129var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 2205var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 2241var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 2280var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 2343var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 2387var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 2417var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 2455var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 2493var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 2517var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 2550var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 2614var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 2645var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 2669var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 2698var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 2744var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 2806var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 2842var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 2875var connectionHandler = serviceProvider.GetService<HubConnectionHandler<ConnectionLifetimeHub>>(); 2905var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 3019var connectionHandler = serviceProvider.GetService<HubConnectionHandler<LongRunningHub>>(); 3078var connectionHandler = serviceProvider.GetService<HubConnectionHandler<LongRunningHub>>(); 3105var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 3148var connectionHandler = serviceProvider.GetService<HubConnectionHandler<OnConnectedThrowsHub>>(); 3183var connectionHandler = serviceProvider.GetService<HubConnectionHandler<StreamingHub>>(); 3218var connectionHandler = serviceProvider.GetService<HubConnectionHandler<StreamingHub>>(); 3232var hubActivator = serviceProvider.GetService<IHubActivator<StreamingHub>>() as CustomHubActivator<StreamingHub>; 3253var connectionHandler = serviceProvider.GetService<HubConnectionHandler<StreamingHub>>(); 3267var hubActivator = serviceProvider.GetService<IHubActivator<StreamingHub>>() as CustomHubActivator<StreamingHub>; 3288var connectionHandler = serviceProvider.GetService<HubConnectionHandler<StreamingHub>>(); 3303var hubActivator = serviceProvider.GetService<IHubActivator<StreamingHub>>() as CustomHubActivator<StreamingHub>; 3330var connectionHandler = serviceProvider.GetService<HubConnectionHandler<LongRunningHub>>(); 3385var connectionHandler = serviceProvider.GetService<HubConnectionHandler<LongRunningHub>>(); 3441var connectionHandler = serviceProvider.GetService<HubConnectionHandler<LongRunningHub>>(); 3512var connectionHandler = serviceProvider.GetService<HubConnectionHandler<LongRunningHub>>(); 3532var hubActivator = serviceProvider.GetService<IHubActivator<LongRunningHub>>() as CustomHubActivator<LongRunningHub>; 3560var connectionHandler = serviceProvider.GetService<HubConnectionHandler<SimpleHub>>(); 3597var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 3621var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 3644var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 3672var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 3736var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 3772var connectionHandler = serviceProvider.GetService<HubConnectionHandler<LongRunningHub>>(); 3802var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 3821var connectionHandler = serviceProvider.GetService<HubConnectionHandler<ConnectionLifetimeHub>>(); 3844var connectionHandler = serviceProvider.GetService<HubConnectionHandler<ConnectionLifetimeHub>>(); 3868var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 3919var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 3946var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 3971var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 3995var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 4015var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 4034var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 4056var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 4072var hubActivator = serviceProvider.GetService<IHubActivator<MethodHub>>() as CustomHubActivator<MethodHub>; 4094var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 4100var hubActivator = serviceProvider.GetService<IHubActivator<MethodHub>>() as CustomHubActivator<MethodHub>; 4131var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 4168var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 4214var connectionHandler = serviceProvider.GetService<HubConnectionHandler<LongRunningHub>>(); 4255var connectionHandler = serviceProvider.GetService<HubConnectionHandler<LongRunningHub>>(); 4300var connectionHandler = serviceProvider.GetService<HubConnectionHandler<LongRunningHub>>(); 4331var connectionHandler = serviceProvider.GetService<HubConnectionHandler<LongRunningHub>>(); 4358var connectionHandler = serviceProvider.GetService<HubConnectionHandler<LongRunningHub>>(); 4384var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 4409HubConnectionHandler<StreamingHub> connectionHandler = serviceProvider.GetService<HubConnectionHandler<StreamingHub>>(); 4477var connectionHandler = serviceProvider.GetService<HubConnectionHandler<StreamingHub>>(); 4511var connectionHandler = serviceProvider.GetService<HubConnectionHandler<CallerServiceHub>>(); 4538var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 4563var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 4605var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 4628var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 4656var connectionHandler = serviceProvider.GetService<HubConnectionHandler<ServicesHub>>(); 4673var connectionHandler = serviceProvider.GetService<HubConnectionHandler<ServicesHub>>(); 4692var connectionHandler = serviceProvider.GetService<HubConnectionHandler<ServicesHub>>(); 4711var connectionHandler = serviceProvider.GetService<HubConnectionHandler<ServicesHub>>(); 4736var connectionHandler = serviceProvider.GetService<HubConnectionHandler<ServicesHub>>(); 4758var connectionHandler = serviceProvider.GetService<HubConnectionHandler<ServicesHub>>(); 4779var connectionHandler = serviceProvider.GetService<HubConnectionHandler<ServicesHub>>(); 4800var connectionHandler = serviceProvider.GetService<HubConnectionHandler<ServicesHub>>(); 4825var connectionHandler = serviceProvider.GetService<HubConnectionHandler<ServicesHub>>(); 4848var connectionHandler = serviceProvider.GetService<HubConnectionHandler<ServicesHub>>(); 4870var connectionHandler = serviceProvider.GetService<HubConnectionHandler<ServicesHub>>(); 4890var connectionHandler = serviceProvider.GetService<HubConnectionHandler<ServicesHub>>(); 4910var connectionHandler = serviceProvider.GetService<HubConnectionHandler<ServicesHub>>(); 4933var connectionHandler = serviceProvider.GetService<HubConnectionHandler<KeyedServicesHub>>(); 4956var connectionHandler = serviceProvider.GetService<HubConnectionHandler<KeyedServicesHub>>(); 4980var connectionHandler = serviceProvider.GetService<HubConnectionHandler<KeyedServicesHub>>(); 5003var connectionHandler = serviceProvider.GetService<HubConnectionHandler<KeyedServicesHub>>(); 5026var connectionHandler = serviceProvider.GetService<HubConnectionHandler<KeyedServicesHub>>(); 5046var ex = Assert.Throws<InvalidOperationException>(() => serviceProvider.GetService<HubConnectionHandler<KeyedServicesHub>>()); 5062var ex = Assert.Throws<InvalidOperationException>(() => serviceProvider.GetService<HubConnectionHandler<BadServicesHub>>()); 5074() => serviceProvider.GetService<HubConnectionHandler<TooManyParamsHub>>()); 5087var connectionHandler = serviceProvider.GetService<HubConnectionHandler<OnConnectedSendToClientHub>>(); 5117var connectionHandler = serviceProvider.GetService<HubConnectionHandler<ConnectionLifetimeHub>>(); 5141var connectionHandler = serviceProvider.GetService<HubConnectionHandler<ConnectionLifetimeHub>>(); 5172var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 5200var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 5245var connectionHandler = serviceProvider.GetService<HubConnectionHandler<ConnectionLifetimeHub>>(); 5308var connectionHandler = serviceProvider.GetService<HubConnectionHandler<ConnectionLifetimeHub>>();
HubFilterTests.cs (18)
114var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 153var connectionHandler = serviceProvider.GetService<HubConnectionHandler<DynamicTestHub>>(); 188var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 238var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 289var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 337var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 397var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 459var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 539var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 588var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 631var connectionHandler = serviceProvider.GetService<HubConnectionHandler<OnConnectedThrowsHub>>(); 662var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 692var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 729var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 770var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 805var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 846var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>(); 884var connectionHandler = serviceProvider.GetService<HubConnectionHandler<MethodHub>>();
Microsoft.AspNetCore.SignalR.Tests.Utils (1)
src\Shared\SignalR\InProcessTestServer.cs (1)
125_url = _host.Services.GetService<IServer>().Features.Get<IServerAddressesFeature>().Addresses.Single();
Microsoft.AspNetCore.SpaServices.Extensions (4)
SpaApplicationBuilderExtensions.cs (1)
34var optionsProvider = app.ApplicationServices.GetService<IOptions<SpaOptions>>()!;
StaticFiles\SpaStaticFilesExtensions.cs (2)
30var optionsProvider = serviceProvider.GetService<IOptions<SpaStaticFilesOptions>>()!; 110var spaStaticFilesService = app.ApplicationServices.GetService<ISpaStaticFileProvider>();
Util\LoggerFinder.cs (1)
18var loggerFactory = appBuilder.ApplicationServices.GetService<ILoggerFactory>();
Microsoft.AspNetCore.StaticFiles.FunctionalTests (3)
Helpers.cs (1)
15return server.Services.GetService<IServer>().Features.Get<IServerAddressesFeature>().Addresses.First();
StaticFileMiddlewareTests.cs (2)
154var hostingEnvironment = host.Services.GetService<IWebHostEnvironment>(); 196var hostingEnvironment = host.Services.GetService<IWebHostEnvironment>();
Microsoft.AspNetCore.TestHost.Tests (5)
TestServerTests.cs (5)
87Assert.IsType<NoopHostLifetime>(host.Services.GetService<IHostLifetime>()); 335Assert.Equal(testService, testServer.Services.GetService<TestService>()); 358Assert.Equal(testService, testServer.Services.GetService<TestService>()); 430var service = context.RequestServices.GetService<TestService>(); 914var service = app.ApplicationServices.GetService<SimpleService>();
Microsoft.AspNetCore.Tests (4)
WebApplicationTests.cs (3)
1388var config = sp.GetService<IConfiguration>(); 1405var config = sp.GetService<IConfiguration>(); 1533var config = serviceProvider.GetService<IConfiguration>();
WebHostTests.cs (1)
121var routeOptions = host.Services.GetService<IOptions<RouteOptions>>();
Microsoft.AspNetCore.WebSockets.Tests (1)
IHostPortExtensions.cs (1)
26return host.Services.GetService<IServer>().Features.Get<IServerAddressesFeature>().Addresses
Microsoft.Extensions.Caching.Hybrid (3)
Internal\DefaultHybridCache.cs (2)
60_logger = services.GetService<ILoggerFactory>()?.CreateLogger(typeof(HybridCache)) ?? NullLogger.Instance; 62_backendCache = services.GetService<IDistributedCache>(); // note optional
Internal\DefaultHybridCache.Serialization.cs (1)
34var serializer = @this._services.GetService<IHybridCacheSerializer<T>>();
Microsoft.Extensions.Caching.Hybrid.Tests (6)
DistributedCacheTests.cs (4)
56var cache = (await InitAsync()).BuildServiceProvider().GetService<IDistributedCache>(); 102var cache = (await InitAsync()).BuildServiceProvider().GetService<IDistributedCache>(); 168var cache = (await InitAsync()).BuildServiceProvider().GetService<IDistributedCache>() as IBufferDistributedCache; 228var cache = (await InitAsync()).BuildServiceProvider().GetService<IDistributedCache>() as IBufferDistributedCache;
ServiceConstructionTests.cs (2)
27Assert.IsType<DefaultHybridCache>(provider.GetService<HybridCache>()); 40var obj = Assert.IsType<DefaultHybridCache>(provider.GetService<HybridCache>());
Microsoft.Extensions.DependencyInjection.Abstractions (1)
ActivatorUtilities.cs (1)
86IServiceProviderIsService? serviceProviderIsService = provider.GetService<IServiceProviderIsService>();
Microsoft.Extensions.Hosting (1)
HostBuilder.cs (1)
366_ = serviceProvider.GetService<IConfiguration>();
Microsoft.Extensions.Http (1)
DefaultHttpMessageHandlerBuilder.cs (1)
71if (Services.GetService<IOptionsMonitor<HttpClientFactoryOptions>>() is IOptionsMonitor<HttpClientFactoryOptions> optionsMonitor)
Microsoft.Extensions.Http.Polly (1)
DependencyInjection\PollyServiceCollectionExtensions.cs (1)
32var registry = services.BuildServiceProvider().GetService<IPolicyRegistry<string>>();
Microsoft.Extensions.Http.Polly.Tests (12)
DependencyInjection\PollyHttpClientBuilderExtensionsTest.cs (12)
452var registry = services.GetService<IPolicyRegistry<string>>(); 456Assert.Same(registry, services.GetService<IConcurrentPolicyRegistry<string>>()); 457Assert.Same(registry, services.GetService<IReadOnlyPolicyRegistry<string>>()); 472Assert.Same(registry, services.GetService<IConcurrentPolicyRegistry<string>>()); 473Assert.Same(registry, services.GetService<IPolicyRegistry<string>>()); 474Assert.Same(registry, services.GetService<IReadOnlyPolicyRegistry<string>>()); 489var registry = services.GetService<IPolicyRegistry<string>>(); 493Assert.Same(registry, services.GetService<IConcurrentPolicyRegistry<string>>()); 494Assert.Same(registry, services.GetService<IReadOnlyPolicyRegistry<string>>()); 514Assert.Same(existingRegistry, services.GetService<IPolicyRegistry<string>>()); 515Assert.Same(existingRegistry, services.GetService<IConcurrentPolicyRegistry<string>>()); 516Assert.Same(existingRegistry, services.GetService<IReadOnlyPolicyRegistry<string>>());
Microsoft.Extensions.Identity.Core (5)
UserManager.cs (5)
128if (services?.GetService<ILookupProtector>() == null) 543var keyRing = _services.GetService<ILookupProtectorKeyRing>(); 544var protector = _services.GetService<ILookupProtector>(); 1298var keyRing = _services.GetService<ILookupProtectorKeyRing>(); 1299var protector = _services.GetService<ILookupProtector>();
Microsoft.Extensions.WebEncoders (1)
EncoderServiceCollectionExtensions.cs (1)
67?.GetService<IOptions<WebEncoderOptions>>()
NativeIISSample (1)
Startup.cs (1)
99var server = context.RequestServices.GetService<IServer>();