82 implementations of GetService
Microsoft.AspNetCore.Components.Authorization.Tests (1)
src\Components\Shared\test\TestServiceProvider.cs (1)
25public object? GetService(Type serviceType)
Microsoft.AspNetCore.Components.Forms.Tests (1)
src\Components\Shared\test\TestServiceProvider.cs (1)
25public object? GetService(Type serviceType)
Microsoft.AspNetCore.Components.Performance (1)
RenderTreeDiffBuilderBenchmark.cs (1)
106public object GetService(Type serviceType)
Microsoft.AspNetCore.Components.Tests (1)
src\Components\Shared\test\TestServiceProvider.cs (1)
25public object? GetService(Type serviceType)
Microsoft.AspNetCore.Components.Web.Tests (1)
src\Components\Shared\test\TestServiceProvider.cs (1)
25public object? GetService(Type serviceType)
Microsoft.AspNetCore.Diagnostics.Tests (1)
ExceptionHandlerMiddlewareTest.cs (1)
527public object GetService(Type serviceType)
Microsoft.AspNetCore.Hosting (1)
GenericHost\GenericWebHostBuilder.cs (1)
369public object? GetService(Type serviceType)
Microsoft.AspNetCore.Hosting.Tests (2)
Internal\MyContainer.cs (1)
19public object GetService(Type serviceType)
WebHostTests.AsyncDisposable.cs (1)
74public object GetService(Type serviceType) => _serviceProvider.GetService(serviceType);
Microsoft.AspNetCore.Http.Abstractions (2)
EndpointFilterFactoryContext.cs (1)
30public object? GetService(Type serviceType) => null;
Extensions\EndpointBuilder.cs (1)
49public object? GetService(Type serviceType) => null;
Microsoft.AspNetCore.Http.Abstractions.Tests (1)
UseMiddlewareTest.cs (1)
262public object? GetService(Type serviceType)
Microsoft.AspNetCore.Http.Connections (1)
Internal\HttpConnectionDispatcher.cs (1)
837public object? GetService(Type serviceType) => null;
Microsoft.AspNetCore.Http.Extensions (1)
RequestDelegateFactory.cs (1)
2865public object? GetService(Type serviceType) => null;
Microsoft.AspNetCore.Http.Extensions.Tests (3)
RequestDelegateFactoryTests.cs (1)
3684public object? GetService(Type serviceType)
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
453public object GetService(Type serviceType)
RequestDelegateGenerator\RequestDelegateCreationTests.KeyServices.cs (1)
229public object GetService(Type serviceType)
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
453public object GetService(Type serviceType)
Microsoft.AspNetCore.Http.Results.Tests (2)
EmptyServiceProvider.cs (1)
10public object GetService(Type serviceType) => null;
ResultsOfTTests.cs (1)
104public object GetService(Type serviceType) => null;
Microsoft.AspNetCore.Http.Tests (1)
DefaultHttpContextTests.cs (1)
521public object GetService(Type serviceType)
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
EndpointMetadataApiDescriptionProviderTest.cs (1)
1505public object? GetService(Type serviceType)
Microsoft.AspNetCore.Mvc.Core.Test (1)
AcceptedAtActionResultTests.cs (1)
290public object GetService(Type serviceType) => new ForwardingUrlHelperFactory();
Microsoft.AspNetCore.OpenApi.Tests (1)
Services\OpenApiDocumentServiceTestsBase.cs (1)
269public object GetService(Type serviceType)
Microsoft.AspNetCore.Owin (1)
OwinExtensions.cs (1)
185public object GetService(Type serviceType)
Microsoft.AspNetCore.Routing (2)
Builder\EndpointRouteBuilderExtensions.cs (1)
471public object? GetService(Type serviceType) => null;
RouteGroupContext.cs (1)
43public object? GetService(Type serviceType) => null;
Microsoft.AspNetCore.Routing.Microbenchmarks (1)
src\Http\Routing\test\UnitTests\TestObjects\TestServiceProvider.cs (1)
8public object GetService(Type serviceType) => null;
Microsoft.AspNetCore.Routing.Tests (7)
Builder\FallbackEndpointRouteBuilderExtensionsTest.cs (1)
51public object? GetService(Type serviceType) => null;
Builder\GroupTest.cs (1)
400public object? GetService(Type serviceType) => null;
Builder\RequestDelegateEndpointRouteBuilderExtensionsTest.cs (1)
596public object? GetService(Type serviceType) => null;
Builder\RouteHandlerEndpointRouteBuilderExtensionsTest.cs (1)
1173public object? GetService(Type serviceType)
EndpointMiddlewareTest.cs (1)
418public object GetService(Type serviceType)
RouterMiddlewareTest.cs (1)
149public object GetService(Type serviceType)
TestObjects\TestServiceProvider.cs (1)
8public object GetService(Type serviceType) => null;
Microsoft.AspNetCore.Tests (1)
WebApplicationTests.cs (1)
3194public object GetService(Type serviceType) => _inner.GetService(serviceType);
Microsoft.Extensions.DependencyInjection (2)
ServiceLookup\ServiceProviderEngineScope.cs (1)
43public object? GetService(Type serviceType)
ServiceProvider.cs (1)
101public object? GetService(Type serviceType) => GetService(ServiceIdentifier.FromServiceType(serviceType), Root);
MockHostTypes (1)
ServiceProvider.cs (1)
10public object GetService(Type serviceType) => null;
PresentationBuildTasks (1)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\TypeContext.cs (1)
69virtual public object GetService(Type serviceType)
PresentationFramework (25)
MS\Internal\Data\DefaultValueConverter.cs (1)
732virtual public object GetService(Type serviceType)
MS\Internal\Documents\FixedDocumentPaginator.cs (1)
199object IServiceProvider.GetService(Type serviceType)
MS\Internal\Documents\FixedDocumentSequencePaginator.cs (1)
199object IServiceProvider.GetService(Type serviceType)
MS\Internal\Documents\FlowDocumentPaginator.cs (1)
1071object IServiceProvider.GetService(Type serviceType)
MS\Internal\Documents\FlowDocumentView.cs (1)
741object IServiceProvider.GetService(Type serviceType)
MS\Internal\Documents\TextBoxView.cs (1)
61object IServiceProvider.GetService(Type serviceType)
MS\Internal\PtsHost\FlowDocumentPage.cs (1)
1155object IServiceProvider.GetService(Type serviceType)
System\Windows\Controls\ContentPresenter.cs (1)
1147object IServiceProvider.GetService(Type serviceType) { return null; }
System\Windows\Controls\FlowDocumentScrollViewer.cs (1)
1888object IServiceProvider.GetService(Type serviceType)
System\Windows\Controls\Primitives\DocumentPageView.cs (1)
1027object IServiceProvider.GetService(Type serviceType)
System\Windows\Controls\Primitives\DocumentViewerBase.cs (1)
1772object IServiceProvider.GetService(Type serviceType)
System\Windows\Controls\TextBlock.cs (1)
278object IServiceProvider.GetService(Type serviceType)
System\Windows\Documents\DocumentSequence.cs (2)
70object IServiceProvider.GetService(Type serviceType) 1090object IServiceProvider.GetService(Type serviceType)
System\Windows\Documents\DPTypeDescriptorContext.cs (1)
182object IServiceProvider.GetService(Type serviceType)
System\Windows\Documents\FixedDocument.cs (2)
102object IServiceProvider.GetService(Type serviceType) 1386object IServiceProvider.GetService(Type serviceType)
System\Windows\Documents\FlowDocument.cs (1)
1696object IServiceProvider.GetService(Type serviceType)
System\Windows\Markup\Baml2006\DeferredBinaryDeserializerExtension.cs (1)
68object IServiceProvider.GetService(Type serviceType)
System\Windows\Markup\Baml2006\TypeConverterMarkupExtension.cs (1)
35object IServiceProvider.GetService(Type serviceType)
System\Windows\Markup\Primitives\ElementMarkupObject.cs (1)
1260public object GetService(Type serviceType)
System\Windows\Markup\Primitives\MarkupWriter.cs (1)
1503public object GetService(Type serviceType)
System\Windows\Markup\ProvideValueServiceProvider.cs (1)
101public object GetService(Type service)
System\Windows\Markup\TypeContext.cs (1)
69virtual public object GetService(Type serviceType)
System\Windows\TemplateContent.cs (1)
1429object IServiceProvider.GetService(Type serviceType)
ReachFramework (2)
Packaging\XpsResourcePolicy.cs (1)
172IServiceProvider.GetService(
Serialization\Manager\XpsTokenContext.cs (1)
92GetService(
System.ComponentModel.Annotations (1)
System\ComponentModel\DataAnnotations\ValidationContext.cs (1)
249public object? GetService(Type serviceType) => _serviceProvider?.Invoke(serviceType);
System.ComponentModel.TypeConverter (5)
System\ComponentModel\Container.cs (1)
263public object? GetService(Type service)
System\ComponentModel\Design\ServiceContainer.cs (1)
168public virtual object? GetService(Type serviceType)
System\ComponentModel\LicenseContext.cs (1)
27public virtual object? GetService(Type type) => null;
System\ComponentModel\MarshalByValueComponent.cs (1)
147public virtual object? GetService(Type service) => _site?.GetService(service);
System\ComponentModel\NestedContainer.cs (1)
121public object? GetService(Type service)
System.Xaml (2)
System\Xaml\Context\ServiceProviderContext.cs (1)
37object IServiceProvider.GetService(Type serviceType)
System\Xaml\XamlObjectReader.cs (1)
2817public object GetService(Type serviceType)
System.Xaml.Tests (7)
System\Windows\Markup\NameReferenceConverterTests.cs (1)
207public object GetService(Type serviceType)
System\Windows\Markup\ReferenceTests.cs (1)
101public object GetService(Type serviceType)
System\Windows\Markup\StaticExtensionTests.cs (1)
251public object GetService(Type serviceType)
System\Windows\Markup\TypeExtensionTests.cs (1)
213public object GetService(Type serviceType)
System\Windows\Markup\ValueSerializerTests.cs (1)
452public object GetService(Type serviceType) => throw new NotImplementedException();
System\Windows\Markup\XamlSetMarkupExtensionEventArgsTests.cs (1)
42public object GetService(Type serviceType) => throw new NotImplementedException();
System\Windows\Markup\XamlSetTypeConverterEventArgsTests.cs (1)
51public object GetService(Type serviceType) => throw new NotImplementedException();
263 references to GetService
GetDocument.Insider (1)
Commands\GetDocumentCommandWorker.cs (1)
250var service = services.GetService(serviceType);
Microsoft.AspNetCore.Antiforgery (1)
AntiforgeryApplicationBuilderExtensions.cs (1)
34if (builder.ApplicationServices.GetService(typeof(IAntiforgery)) == null)
Microsoft.AspNetCore.Authentication.Core (1)
AuthenticationHandlerProvider.cs (1)
49var handler = (context.RequestServices.GetService(scheme.HandlerType) ??
Microsoft.AspNetCore.Authorization.Policy (1)
AuthorizationAppBuilderExtensions.cs (1)
40if (app.ApplicationServices.GetService(typeof(AuthorizationPolicyMarkerService)) == null)
Microsoft.AspNetCore.Components (1)
ComponentFactory.cs (1)
148serviceInstance = serviceProvider.GetService(propertyType)
Microsoft.AspNetCore.Components.Server.Tests (1)
Circuits\TestCircuitHost.cs (1)
35.Setup(services => services.GetService(typeof(IJSRuntime)))
Microsoft.AspNetCore.Connections.Abstractions (2)
src\Shared\ActivatorUtilities\ActivatorUtilities.cs (2)
94return provider.GetService(type) ?? CreateInstance(provider, type); 153var value = provider.GetService(parameter.ParameterType);
Microsoft.AspNetCore.DataProtection.Abstractions (1)
DataProtectionCommonExtensions.cs (1)
99var provider = (IDataProtectionProvider?)services.GetService(typeof(IDataProtectionProvider));
Microsoft.AspNetCore.DataProtection.Abstractions.Tests (6)
DataProtectionCommonExtensionsTests.cs (6)
126mockServices.Setup(o => o.GetService(typeof(IDataProtectionProvider))).Returns(expected); 146mockServices.Setup(o => o.GetService(typeof(IDataProtectionProvider))).Returns(mockProtector.Object); 165mockServices.Setup(o => o.GetService(typeof(IDataProtectionProvider))).Returns(mockProtector.Object); 189mockServices.Setup(o => o.GetService(typeof(IDataProtectionProvider))).Returns(firstMock.Object); 213mockServices.Setup(o => o.GetService(typeof(IDataProtectionProvider))).Returns(firstMock.Object); 233mockServices.Setup(o => o.GetService(typeof(IDataProtectionProvider))).Returns(firstMock.Object);
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (2)
HttpContextDatabaseContextDetailsExtensions.cs (1)
21var context = (DbContext?)httpContext.RequestServices.GetService(dbcontextType);
MigrationsEndPointMiddleware.cs (1)
126var db = (DbContext?)context.RequestServices.GetService(contextType);
Microsoft.AspNetCore.Diagnostics.HealthChecks (2)
Builder\HealthCheckApplicationBuilderExtensions.cs (1)
193if (app.ApplicationServices.GetService(typeof(HealthCheckService)) == null)
Builder\HealthCheckEndpointRouteBuilderExtensions.cs (1)
57if (endpoints.ServiceProvider.GetService(typeof(HealthCheckService)) == null)
Microsoft.AspNetCore.FunctionalTests (4)
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));
WebHostFunctionalTests.cs (1)
124var factory = (ILoggerFactory)webHost.Services.GetService(typeof(ILoggerFactory));
Microsoft.AspNetCore.Hosting.Tests (1)
Internal\MyContainer.cs (1)
21return _inner.GetService(serviceType);
Microsoft.AspNetCore.Http (1)
Builder\ApplicationBuilder.cs (1)
50_debugger = (IDebugger?)serviceProvider?.GetService(typeof(IDebugger)) ?? DebuggerWrapper.Instance;
Microsoft.AspNetCore.Http.Abstractions (3)
Extensions\UseMiddlewareExtensions.cs (1)
297var service = sp.GetService(type);
src\Shared\ActivatorUtilities\ActivatorUtilities.cs (2)
94return provider.GetService(type) ?? CreateInstance(provider, type); 153var value = provider.GetService(parameter.ParameterType);
Microsoft.AspNetCore.Http.Extensions.Tests (3)
RequestDelegateFactoryTests.cs (1)
862mock.Setup(m => m.GetService(It.IsAny<Type>())).Returns<Type>(t =>
RequestDelegateGenerator\RequestDelegateCreationTests.BindAsync.cs (2)
223mock.Setup(m => m.GetService(It.IsAny<Type>())).Returns<Type>(t => 279mock.Setup(m => m.GetService(It.IsAny<Type>())).Returns<Type>(t =>
Microsoft.AspNetCore.Mvc.Core (2)
Builder\MvcApplicationBuilderExtensions.cs (1)
121if (app.ApplicationServices.GetService(typeof(MvcMarkerService)) == null)
ModelBinding\Binders\ServicesModelBinder.cs (1)
26requestServices.GetService(bindingContext.ModelType) :
Microsoft.AspNetCore.Mvc.Core.Test (12)
Controllers\DefaultControllerActivatorTest.cs (4)
121serviceProvider.Setup(s => s.GetService(typeof(TestService))) 171.Setup(s => s.GetService(typeof(IUrlHelper))) 174.Setup(s => s.GetService(typeof(IModelMetadataProvider))) 177.Setup(s => s.GetService(typeof(IObjectModelValidator)))
Controllers\DefaultControllerFactoryTest.cs (3)
223.Setup(s => s.GetService(typeof(IUrlHelper))) 226.Setup(s => s.GetService(typeof(IModelMetadataProvider))) 229.Setup(s => s.GetService(typeof(IObjectModelValidator)))
Controllers\ServiceBasedControllerActivatorTest.cs (1)
19serviceProvider.Setup(s => s.GetService(typeof(DIController)))
Infrastructure\ControllerActionInvokerTest.cs (1)
1406context.Setup(c => c.RequestServices.GetService(typeof(ILoggerFactory)))
ResponseCacheAttributeTest.cs (2)
336.Setup(s => s.GetService(typeof(IOptions<MvcOptions>))) 339.Setup(s => s.GetService(typeof(ILoggerFactory)))
Routing\AttributeRouteTest.cs (1)
77.Setup(s => s.GetService(typeof(ILoggerFactory)))
Microsoft.AspNetCore.Mvc.FunctionalTests (6)
TestingInfrastructureInheritanceTests.cs (2)
63Assert.NotNull(factory.Services.GetService(typeof(IConfiguration))); 73var lifetimeService = (IHostApplicationLifetime)factory.Services.GetService(typeof(IHostApplicationLifetime));
TestingInfrastructureTests.cs (4)
202Assert.NotNull(factory.Services.GetService(typeof(IConfiguration))); 211Assert.NotNull(factory.Services.GetService(typeof(IConfiguration))); 220Assert.NotNull(factory.Services.GetService(typeof(IConfiguration))); 229Assert.NotNull(factory.Services.GetService(typeof(IConfiguration)));
Microsoft.AspNetCore.Mvc.IntegrationTests (1)
ModelBindingTestContext.cs (1)
16return (T)HttpContext.RequestServices.GetService(typeof(T));
Microsoft.AspNetCore.Mvc.Razor.Test (5)
RazorPageCreateTagHelperTest.cs (4)
76serviceProvider.Setup(mock => mock.GetService(typeof(MyService))) 78serviceProvider.Setup(mock => mock.GetService(typeof(ITagHelperFactory))) 80serviceProvider.Setup(mock => mock.GetService(typeof(ITagHelperActivator))) 82serviceProvider.Setup(mock => mock.GetService(It.Is<Type>(serviceType =>
RazorPageTest.cs (1)
849services.Setup(s => s.GetService(typeof(IUrlHelperFactory)))
Microsoft.AspNetCore.Mvc.RazorPages.Test (2)
Infrastructure\ServiceBasedPageModelActivatorProviderTest.cs (2)
33serviceProvider.Setup(s => s.GetService(typeof(DISimpleModel))) 65serviceProvider.Setup(s => s.GetService(typeof(DISimpleModel)))
Microsoft.AspNetCore.Mvc.Test (1)
MvcServiceCollectionExtensionsTest.cs (1)
421scope.ServiceProvider.GetService(typeof(IEnumerable<>).MakeGenericType(serviceType));
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (15)
Rendering\HtmlHelperFormTest.cs (12)
339serviceProvider.Setup(s => s.GetService(typeof(HtmlEncoder))).Returns(new HtmlTestEncoder()); 386serviceProvider.Setup(s => s.GetService(typeof(HtmlEncoder))).Returns(new HtmlTestEncoder()); 424serviceProvider.Setup(s => s.GetService(typeof(HtmlEncoder))).Returns(new HtmlTestEncoder()); 463serviceProvider.Setup(s => s.GetService(typeof(HtmlEncoder))).Returns(new HtmlTestEncoder()); 501serviceProvider.Setup(s => s.GetService(typeof(HtmlEncoder))).Returns(new HtmlTestEncoder()); 541serviceProvider.Setup(s => s.GetService(typeof(HtmlEncoder))).Returns(new HtmlTestEncoder()); 580serviceProvider.Setup(s => s.GetService(typeof(HtmlEncoder))).Returns(new HtmlTestEncoder()); 620serviceProvider.Setup(s => s.GetService(typeof(HtmlEncoder))).Returns(new HtmlTestEncoder()); 657serviceProvider.Setup(s => s.GetService(typeof(HtmlEncoder))).Returns(new HtmlTestEncoder()); 700serviceProvider.Setup(s => s.GetService(typeof(HtmlEncoder))).Returns(new HtmlTestEncoder()); 742serviceProvider.Setup(s => s.GetService(typeof(HtmlEncoder))).Returns(new HtmlTestEncoder()); 786serviceProvider.Setup(s => s.GetService(typeof(HtmlEncoder))).Returns(new HtmlTestEncoder());
ViewComponents\ViewViewComponentResultTest.cs (3)
350serviceProvider.Setup(p => p.GetService(typeof(ICompositeViewEngine))) 352serviceProvider.Setup(p => p.GetService(typeof(DiagnosticListener))) 516serviceProvider.Setup(s => s.GetService(typeof(DiagnosticListener))).Returns(diagnosticSource);
Microsoft.AspNetCore.OpenApi.Tests (1)
Services\OpenApiDocumentServiceTestsBase.cs (1)
276return _serviceProvider.GetService(serviceType);
Microsoft.AspNetCore.OutputCaching.Tests (6)
TestUtils.cs (6)
224serviceProvider.Setup(x => x.GetService(typeof(IOutputCacheStore))).Returns(cache ?? new SimpleTestOutputCache()); 225serviceProvider.Setup(x => x.GetService(typeof(IOptions<OutputCacheOptions>))).Returns(Options.Create(options ?? new OutputCacheOptions())); 226serviceProvider.Setup(x => x.GetService(typeof(ILogger<OutputCacheMiddleware>))).Returns(testSink == null ? NullLogger.Instance : new TestLogger("OutputCachingTests", testSink, true)); 244serviceProvider.Setup(x => x.GetService(typeof(IOutputCacheStore))).Returns(cache ?? new SimpleTestOutputCache()); 245serviceProvider.Setup(x => x.GetService(typeof(IOptions<OutputCacheOptions>))).Returns(Options.Create(options ?? new OutputCacheOptions())); 246serviceProvider.Setup(x => x.GetService(typeof(ILogger<OutputCacheMiddleware>))).Returns(testSink == null ? NullLogger.Instance : new TestLogger("OutputCachingTests", testSink, true));
Microsoft.AspNetCore.RateLimiting.Tests (3)
RateLimitingMiddlewareTests.cs (3)
399.Setup(sp => sp.GetService(typeof(string))) 402.Setup(sp => sp.GetService(typeof(int))) 405.Setup(sp => sp.GetService(typeof(bool)))
Microsoft.AspNetCore.Routing (4)
Builder\EndpointRoutingApplicationBuilderExtensions.cs (1)
120if (app.ApplicationServices.GetService(typeof(RoutingMarkerService)) == null)
Builder\RoutingBuilderExtensions.cs (2)
25if (builder.ApplicationServices.GetService(typeof(RoutingMarkerService)) == null) 48if (builder.ApplicationServices.GetService(typeof(RoutingMarkerService)) == null)
RouteBuilder.cs (1)
35if (applicationBuilder.ApplicationServices.GetService(typeof(RoutingMarkerService)) == null)
Microsoft.AspNetCore.Routing.Tests (10)
Matching\CandidateSetTest.cs (5)
124services.Setup(s => s.GetService(typeof(IEnumerable<MatcherPolicy>))).Returns(new[] { new TestMetadataMatcherPolicy(), }); 167services.Setup(s => s.GetService(typeof(IEnumerable<MatcherPolicy>))).Returns(new[] { new TestMetadataMatcherPolicy(), }); 217services.Setup(s => s.GetService(typeof(IEnumerable<MatcherPolicy>))).Returns(new[] { new TestMetadataMatcherPolicy(), }); 274services.Setup(s => s.GetService(typeof(IEnumerable<MatcherPolicy>))).Returns(new[] { new TestMetadataMatcherPolicy(), }); 317services.Setup(s => s.GetService(typeof(IEnumerable<MatcherPolicy>))).Returns(new[] { new TestMetadataMatcherPolicy(), });
RouteCollectionTest.cs (2)
663context.Setup(m => m.RequestServices.GetService(typeof(ILoggerFactory))) 665context.Setup(m => m.RequestServices.GetService(typeof(IOptions<RouteOptions>)))
RouteTest.cs (1)
592context.Setup(m => m.RequestServices.GetService(typeof(ILoggerFactory)))
Tree\TreeRouterTest.cs (2)
1989context.Setup(m => m.RequestServices.GetService(typeof(ILoggerFactory))) 2003mockHttpContext.Setup(h => h.RequestServices.GetService(typeof(ILoggerFactory)))
Microsoft.AspNetCore.Shared.Tests (2)
src\Shared\ActivatorUtilities\ActivatorUtilities.cs (2)
94return provider.GetService(type) ?? CreateInstance(provider, type); 153var value = provider.GetService(parameter.ParameterType);
Microsoft.AspNetCore.SignalR.Core (2)
Internal\HubFilterFactory.cs (1)
89var filter = (IHubFilter?)serviceProvider.GetService(_filterType);
SignalRConnectionBuilderExtensions.cs (1)
25var marker = connectionBuilder.ApplicationServices.GetService(typeof(SignalRCoreMarkerService));
Microsoft.AspNetCore.SignalR.Tests (3)
DefaultHubActivatorTests.cs (2)
31.Setup(sp => sp.GetService(typeof(Hub))) 43.Setup(sp => sp.GetService(typeof(Hub)))
HubConnectionHandlerTestUtils\Utils.cs (1)
78return (Connections.ConnectionHandler)serviceProvider.GetService(GetConnectionHandlerType(hubType));
Microsoft.AspNetCore.SpaServices.Extensions (1)
SpaDefaultPageMiddleware.cs (1)
58var hostEnvironment = (IWebHostEnvironment?)context.RequestServices.GetService(typeof(IWebHostEnvironment));
Microsoft.AspNetCore.Tests (3)
WebApplicationTests.cs (2)
1463var linkGenerator = app.Services.GetService(typeof(LinkGenerator)); 3194public object GetService(Type serviceType) => _inner.GetService(serviceType);
WebHostTests.cs (1)
93var linkGenerator = host.Services.GetService(typeof(LinkGenerator));
Microsoft.Extensions.DependencyInjection.Abstractions (5)
ActivatorUtilities.cs (3)
376return provider.GetService(type) ?? CreateInstance(provider, type); 381object? service = key == null ? sp.GetService(type) : GetKeyedService(sp, type, key); 796return serviceProvider.GetService(parameterInfo.ParameterType);
ServiceProviderServiceExtensions.cs (2)
25return (T?)provider.GetService(typeof(T)); 45object? service = provider.GetService(serviceType);
Microsoft.Extensions.Http (21)
DependencyInjection\HttpClientBuilderExtensions.cs (4)
346/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 412/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 472/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 518/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing
DependencyInjection\HttpClientFactoryServiceCollectionExtensions.cs (16)
196/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 236/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 273/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 316/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 357/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 396/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 439/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 483/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 523/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 565/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 611/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 658/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 703/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 740/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 782/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 819/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing
ITypedHttpClientFactory.cs (1)
21/// should rarely be used directly in application code, use <see cref="IServiceProvider.GetService(Type)"/> instead
PresentationCore (4)
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Media\TypeConverterHelper.cs (1)
81IUriContext iuc = (IUriContext)context.GetService(typeof(IUriContext));
System\Windows\Media\Brush.cs (1)
72freezer = (IFreezeFreezables)context.GetService(typeof(IFreezeFreezables));
System\Windows\Media\FontFamilyConverter.cs (1)
106IUriContext iuc = (IUriContext)context.GetService(typeof(IUriContext));
System\Windows\Media\ImageSourceConverter.cs (1)
171IProvideValueTarget ipvt = context?.GetService(typeof(IProvideValueTarget)) as IProvideValueTarget;
PresentationFramework (77)
MS\Internal\Annotations\Anchoring\FixedTextSelectionProcessor.cs (2)
300ITextView tv = (ITextView)((IServiceProvider)docPage).GetService(typeof(ITextView)); 603textView = ((IServiceProvider)documentPage).GetService(typeof(ITextView)) as ITextView;
MS\Internal\Annotations\Anchoring\TextSelectionHelper.cs (5)
405return provider.GetService(typeof(ITextView)) as ITextView; 415return isp.GetService(typeof(ITextView)) as ITextView; 444res.Add(provider.GetService(typeof(ITextView)) as ITextView); 497ITextView view = isp.GetService(typeof(ITextView)) as ITextView; 542ITextView textView = serviceProvider.GetService(typeof(ITextView)) as ITextView;
MS\Internal\Annotations\Anchoring\TextSelectionProcessor.cs (2)
276textView = serviceProvider.GetService(typeof(ITextView)) as ITextView; 471textContainer = serviceProvider.GetService(typeof(ITextContainer)) as ITextContainer;
MS\Internal\Annotations\Anchoring\TextViewSelectionProcessor.cs (1)
279ITextView textView = provider.GetService(typeof(ITextView)) as ITextView;
MS\Internal\Annotations\Component\MarkedHighlightComponent.cs (1)
938ITextView textView = (ITextView)service.GetService(typeof(ITextView));
MS\Internal\Documents\ContentHostHelper.cs (1)
117textView = (ITextView)((IServiceProvider)pageViews[i].DocumentPage).GetService(typeof(ITextView));
MS\Internal\Documents\DocumentGrid.cs (3)
906_textContainer = (ITextContainer)isp.GetService(typeof(ITextContainer)); 1277_rubberBandSelector = serviceProvider.GetService(typeof(RubberbandSelector)) as RubberbandSelector; 2583((IServiceProvider)pageView).GetService(typeof(ITextView)) as DocumentPageTextView;
MS\Internal\Documents\DocumentPageTextView.cs (3)
51_pageTextView = ((IServiceProvider)_page).GetService(typeof(ITextView)) as ITextView; 77_pageTextView = ((IServiceProvider)_page).GetService(typeof(ITextView)) as ITextView; 357_pageTextView = ((IServiceProvider)_page).GetService(typeof(ITextView)) as ITextView;
MS\Internal\Documents\DocumentViewerHelper.cs (1)
391ITextContainer textContainer = (ITextContainer)((IServiceProvider)document).GetService(typeof(ITextContainer));
MS\Internal\Documents\FixedDocumentPaginator.cs (1)
201return ((IServiceProvider)_document).GetService(serviceType);
MS\Internal\Documents\FixedDocumentSequencePaginator.cs (1)
201return ((IServiceProvider)_document).GetService(serviceType);
MS\Internal\Documents\FlowDocumentPaginator.cs (2)
383textView = (ITextView)((IServiceProvider)flowDocumentPage).GetService(typeof(ITextView)); 1073return ((IServiceProvider)_document).GetService(serviceType);
MS\Internal\Documents\MultiPageTextView.cs (1)
732pageTextView = ((IServiceProvider)pageViews[index]).GetService(typeof(ITextView)) as DocumentPageTextView;
MS\Internal\Helper.cs (2)
580IProvideValueTarget provideValueTarget = serviceProvider.GetService(typeof(IProvideValueTarget)) as IProvideValueTarget; 626System.Xaml.IXamlSchemaContextProvider scp = serviceProvider.GetService(typeof(System.Xaml.IXamlSchemaContextProvider)) as System.Xaml.IXamlSchemaContextProvider;
MS\Internal\LayoutDump.cs (1)
589TextDocumentView tv = (TextDocumentView)((IServiceProvider)flowDocumentPage).GetService(typeof(ITextView));
MS\Internal\Markup\StaticExtension.cs (1)
88IXamlTypeResolver xamlTypeResolver = serviceProvider.GetService(typeof(IXamlTypeResolver)) as IXamlTypeResolver;
MS\Internal\PtsHost\BreakRecordTable.cs (1)
263textView = (ITextView)((IServiceProvider)page).GetService(typeof(ITextView));
MS\Internal\PtsHost\FlowDocumentPage.cs (1)
1051TextDocumentView textView = (TextDocumentView)((IServiceProvider)this).GetService(typeof(ITextView));
System\Windows\Annotations\AnnotationService.cs (1)
1126ITextContainer textContainer = provider.GetService(typeof(ITextContainer)) as ITextContainer;
System\Windows\Application.cs (1)
240service = ServiceProvider.GetService(serviceType);
System\Windows\Automation\Peers\DocumentAutomationPeer.cs (4)
34_textContainer = ((IServiceProvider)owner).GetService(typeof(ITextContainer)) as ITextContainer; 65ITextContainer textContainer = ((IServiceProvider)Owner).GetService(typeof(ITextContainer)) as ITextContainer; 84ITextContainer textContainer = ((IServiceProvider)Owner).GetService(typeof(ITextContainer)) as ITextContainer; 221ITextContainer textContainer = ((IServiceProvider)Owner).GetService(typeof(ITextContainer)) as ITextContainer;
System\Windows\ColorConvertedBitmapExtension.cs (1)
97IUriContext uriContext = serviceProvider.GetService(typeof(IUriContext)) as IUriContext;
System\Windows\Controls\FlowDocumentScrollViewer.cs (2)
1286textView = (ITextView)((IServiceProvider)RenderScope).GetService(typeof(ITextView)); 1904service = ((IServiceProvider)Document).GetService(serviceType);
System\Windows\Controls\Primitives\BulletDecorator.cs (1)
347TextDocumentView tdv = ((IServiceProvider)text).GetService(typeof(ITextView)) as TextDocumentView;
System\Windows\Controls\Primitives\DocumentPageView.cs (2)
526ITextContainer tc = ((IServiceProvider)_documentPaginator).GetService(typeof(ITextContainer)) as ITextContainer; 536service = ((IServiceProvider)_documentPaginator).GetService(serviceType);
System\Windows\Controls\Primitives\DocumentViewerBase.cs (3)
708masterPageTextView = ((IServiceProvider)masterPage).GetService(typeof(ITextView)) as ITextView; 787textView = ((IServiceProvider)masterPage).GetService(typeof(ITextView)) as ITextView; 1647textContainer = ((IServiceProvider)_document).GetService(typeof(ITextContainer)) as ITextContainer;
System\Windows\Controls\Primitives\TextBoxBase.cs (1)
1891ITextView textView = (ITextView)((IServiceProvider)_renderScope).GetService(typeof(ITextView));
System\Windows\DeferrableContentConverter.cs (1)
95T result = provider.GetService(typeof(T)) as T;
System\Windows\Documents\ChildDocumentBlock.cs (1)
235ITextContainer tc = isp.GetService(typeof(ITextContainer)) as ITextContainer;
System\Windows\Documents\DocumentSequence.cs (1)
68/// <see cref="IServiceProvider.GetService" />
System\Windows\Documents\DocumentSequenceTextView.cs (1)
595_childTextView = (ITextView)isp.GetService(typeof(ITextView));
System\windows\Documents\TextEditor.cs (1)
308return (serviceProvider != null) ? serviceProvider.GetService(typeof(ITextView)) as ITextView : null;
System\Windows\EventSetterHandlerConverter.cs (2)
68IRootObjectProvider rootProvider = typeDescriptorContext.GetService(typeof(IRootObjectProvider)) as IRootObjectProvider; 71IProvideValueTarget ipvt = typeDescriptorContext.GetService(typeof(IProvideValueTarget)) as IProvideValueTarget;
System\Windows\Input\Command\CommandConverter.cs (1)
219IXamlTypeResolver xamlTypeResolver = (IXamlTypeResolver)context.GetService(typeof(IXamlTypeResolver));
System\Windows\Markup\Baml2006\DeferredBinaryDeserializerExtension.cs (1)
74return _serviceProvider.GetService(serviceType);
System\Windows\Markup\Baml2006\TypeConverterMarkupExtension.cs (1)
37return _serviceProvider.GetService(serviceType);
System\Windows\Markup\DependencyPropertyConverter.cs (6)
120Baml2006SchemaContext schemaContext = (serviceProvider.GetService(typeof(IXamlSchemaContextProvider)) 152IXamlTypeResolver resolver = serviceProvider.GetService(typeof(IXamlTypeResolver)) 172IAmbientProvider ambientProvider = serviceProvider.GetService(typeof(IAmbientProvider)) 174XamlSchemaContext schemaContext = (serviceProvider.GetService(typeof(IXamlSchemaContextProvider)) 185IXamlSchemaContextProvider ixscp = (serviceProvider.GetService(typeof(IXamlSchemaContextProvider)) 209IAmbientProvider ambientProvider = serviceProvider.GetService(typeof(IAmbientProvider))
System\Windows\Markup\Primitives\ElementMarkupObject.cs (1)
1263return _baseContext.GetService(serviceType);
System\Windows\Markup\RoutedEventConverter.cs (3)
61IXamlTypeResolver resolver = serviceProvider.GetService(typeof(IXamlTypeResolver)) as IXamlTypeResolver; 81GetService(typeof(IXamlSchemaContextProvider)) 84IAmbientProvider iapp = serviceProvider.GetService(typeof(IAmbientProvider)) as IAmbientProvider;
System\Windows\Markup\SetterTriggerConditionValueConverter.cs (1)
104IXamlSchemaContextProvider ixsc = (serviceProvider.GetService(typeof(IXamlSchemaContextProvider))
System\Windows\PropertyPath.cs (1)
873IXamlTypeResolver xtr = (context as IServiceProvider).GetService(typeof(IXamlTypeResolver)) as IXamlTypeResolver;
System\Windows\PropertyPathConverter.cs (1)
164typeDescriptorContext.GetService(typeof(XamlDesignerSerializationManager)) as XamlDesignerSerializationManager;
System\Windows\StaticResourceExtension.cs (3)
117IProvideValueTarget provideValueTarget = serviceProvider.GetService(typeof(IProvideValueTarget)) as IProvideValueTarget; 204var schemaContextProvider = serviceProvider.GetService(typeof(IXamlSchemaContextProvider)) as IXamlSchemaContextProvider; 210var ambientProvider = serviceProvider.GetService(typeof(IAmbientProvider)) as IAmbientProvider;
System\Windows\TemplateContent.cs (3)
223IRootObjectProvider irop = context.GetService(typeof(IRootObjectProvider)) as IRootObjectProvider; 1441return _services.GetService(serviceType); 1472return ((IXamlNamespaceResolver)_services.GetService(typeof(IXamlNamespaceResolver))).GetNamespace(prefix);
System\Windows\TemplateContentLoader.cs (1)
24T result = provider.GetService(typeof(T)) as T;
System\Windows\ThemeDictionaryExtension.cs (1)
78IProvideValueTarget provideValueTarget = serviceProvider.GetService(typeof(IProvideValueTarget)) as IProvideValueTarget;
ReachFramework (9)
Serialization\ColorTypeConverter.cs (1)
287PackageSerializationManager manager = (PackageSerializationManager)context.GetService(typeof(XpsSerializationManager));
Serialization\FontTypeConverter.cs (2)
155PackageSerializationManager manager = (PackageSerializationManager)context.GetService(typeof(XpsSerializationManager)); 169XpsFontSerializationService fontService = (XpsFontSerializationService)resourceServiceProvider.GetService(typeof(XpsFontSerializationService));
Serialization\ImageSourceTypeConverter.cs (2)
177PackageSerializationManager manager = (PackageSerializationManager)context.GetService(typeof(XpsSerializationManager)); 207XpsImageSerializationService imageService = (XpsImageSerializationService)resourceServiceProvider.GetService(typeof(XpsImageSerializationService));
Serialization\Manager\XpsOMSerializationManager.cs (2)
545XpsFontSerializationService fontService = (XpsFontSerializationService)resourceServiceProvider.GetService(typeof(XpsFontSerializationService)); 576XpsFontSerializationService fontService = (XpsFontSerializationService)resourceServiceProvider.GetService(typeof(XpsFontSerializationService));
Serialization\Manager\XpsSerializationManager.cs (2)
208XpsFontSerializationService fontService = (XpsFontSerializationService)resourceServiceProvider.GetService(typeof(XpsFontSerializationService)); 227XpsFontSerializationService fontService = (XpsFontSerializationService)resourceServiceProvider.GetService(typeof(XpsFontSerializationService));
Sockets.BindTests (1)
src\Servers\Kestrel\test\BindTests\AddressRegistrationTests.cs (1)
330var options = ((IOptions<KestrelServerOptions>)host.Services.GetService(typeof(IOptions<KestrelServerOptions>))).Value;
System.ComponentModel.Annotations (2)
System\ComponentModel\DataAnnotations\ValidationContext.cs (2)
94InitializeServiceProvider(localServiceProvider.GetService); 245/// See <see cref="IServiceProvider.GetService(Type)" />.
System.ComponentModel.Primitives (1)
System\ComponentModel\Component.cs (1)
107protected virtual object? GetService(Type service) => _site?.GetService(service);
System.ComponentModel.TypeConverter (20)
System\ComponentModel\Design\ServiceContainer.cs (2)
38get => _parentProvider?.GetService(typeof(IServiceContainer)) as IServiceContainer; 206service = _parentProvider.GetService(serviceType!);
System\ComponentModel\MarshalByValueComponent.cs (1)
147public virtual object? GetService(Type service) => _site?.GetService(service);
System\ComponentModel\ReferenceConverter.cs (3)
54if (context.GetService(typeof(IReferenceService)) is IReferenceService refSvc) 91if (context?.GetService(typeof(IReferenceService)) is IReferenceService refSvc) 133if (context.GetService(typeof(IReferenceService)) is IReferenceService refSvc)
System\ComponentModel\ReflectEventDescriptor.cs (4)
168changeService = (IComponentChangeService?)site.GetService(typeof(IComponentChangeService)); 197IDictionaryService? dict = (IDictionaryService?)site.GetService(typeof(IDictionaryService)); 449changeService = (IComponentChangeService?)site.GetService(typeof(IComponentChangeService)); 473IDictionaryService? dict = (IDictionaryService?)site.GetService(typeof(IDictionaryService));
System\ComponentModel\ReflectPropertyDescriptor.cs (4)
586changeService = (IComponentChangeService?)site.GetService(typeof(IComponentChangeService)); 633changeService = (IComponentChangeService?)site.GetService(typeof(IComponentChangeService)); 1034changeService = (IComponentChangeService?)site.GetService(typeof(IComponentChangeService)); 1096changeService = (IComponentChangeService?)site.GetService(typeof(IComponentChangeService));
System\ComponentModel\ReflectTypeDescriptionProvider.cs (2)
325IDictionaryService? ds = comp.Site.GetService(typeof(IDictionaryService)) as IDictionaryService; 657IExtenderListService? extenderList = component.Site.GetService(typeof(IExtenderListService)) as IExtenderListService;
System\ComponentModel\TypeDescriptor.cs (4)
494if (provider?.GetService(typeof(TypeDescriptionProvider)) is TypeDescriptionProvider p) 647IDesignerHost? host = site.GetService(typeof(IDesignerHost)) as IDesignerHost; 1952componentFilter = site.GetService(typeof(ITypeDescriptorFilterService)) as ITypeDescriptorFilterService; 2551ITypeResolutionService? typeResolutionService = (ITypeResolutionService?)site?.GetService(typeof(ITypeResolutionService));
System.Configuration.ConfigurationManager (1)
System\Configuration\ApplicationSettingsBase.cs (1)
68ISettingsProviderService providerService = owner.Site.GetService(typeof(ISettingsProviderService)) as ISettingsProviderService;
System.Runtime.Caching (2)
System\Runtime\Caching\CacheMemoryMonitor.cs (1)
257memoryCacheManager = host.GetService(typeof(IMemoryCacheManager)) as IMemoryCacheManager;
System\Runtime\Caching\HostFileChangeMonitor.cs (1)
96fcn = host.GetService(typeof(IFileChangeNotificationSystem)) as IFileChangeNotificationSystem;
System.Xaml (10)
System\Windows\Markup\NameReferenceConverter.cs (3)
29var nameResolver = (IXamlNameResolver)context.GetService(typeof(IXamlNameResolver)); 51if (context == null || (context.GetService(typeof(IXamlNameProvider)) as IXamlNameProvider) == null) 69var nameProvider = (IXamlNameProvider)context.GetService(typeof(IXamlNameProvider));
System\Windows\Markup\Reference.cs (1)
29IXamlNameResolver nameResolver = serviceProvider.GetService(typeof(IXamlNameResolver)) as IXamlNameResolver;
System\Windows\Markup\StaticExtension.cs (1)
83IXamlTypeResolver xamlTypeResolver = serviceProvider.GetService(typeof(IXamlTypeResolver)) as IXamlTypeResolver;
System\Windows\Markup\TypeExtension.cs (1)
70IXamlTypeResolver xamlTypeResolver = serviceProvider.GetService(typeof(IXamlTypeResolver)) as IXamlTypeResolver;
System\Xaml\EventConverter.cs (2)
52IRootObjectProvider? rootObjectService = context.GetService(typeof(IRootObjectProvider)) as IRootObjectProvider; 59IDestinationTypeProvider? targetService = context.GetService(typeof(IDestinationTypeProvider)) as IDestinationTypeProvider;
System\Xaml\Replacements\TypeTypeConverter.cs (1)
75=> context.GetService(typeof(TService)) as TService;
System\Xaml\Schema\XamlTypeTypeConverter.cs (1)
89return context.GetService(typeof(TService)) as TService;