Implemented interface member:
property
ServiceProvider
Microsoft.Extensions.DependencyInjection.IServiceScope.ServiceProvider
59 references to ServiceProvider
Microsoft.AspNetCore.Components (1)
OwningComponentBase.cs (1)
43return _scope.Value.ServiceProvider;
Microsoft.AspNetCore.Components.Server (12)
Circuits\CircuitFactory.cs (9)
51var jsRuntime = (RemoteJSRuntime)scope.ServiceProvider.GetRequiredService<IJSRuntime>(); 54var navigationManager = (RemoteNavigationManager)scope.ServiceProvider.GetRequiredService<NavigationManager>(); 55var navigationInterception = (RemoteNavigationInterception)scope.ServiceProvider.GetRequiredService<INavigationInterception>(); 56var scrollToLocationHash = (RemoteScrollToLocationHash)scope.ServiceProvider.GetRequiredService<IScrollToLocationHash>(); 57var circuitActivitySource = scope.ServiceProvider.GetRequiredService<CircuitActivitySource>(); 77var appLifetime = scope.ServiceProvider.GetRequiredService<ComponentStatePersistenceManager>(); 82var serverComponentDeserializer = scope.ServiceProvider.GetRequiredService<IServerComponentDeserializer>(); 85scope.ServiceProvider, 101var circuitHandlers = components.Count == 0 ? [] : scope.ServiceProvider.GetServices<CircuitHandler>()
Circuits\CircuitHost.cs (3)
79Services = scope.ServiceProvider; 792var persistenceManager = _scope.ServiceProvider.GetRequiredService<ComponentStatePersistenceManager>(); 823_circuitHandlers = [.. _scope.ServiceProvider.GetServices<CircuitHandler>().OrderBy(h => h.Order)];
Microsoft.AspNetCore.Components.Server.Tests (1)
Circuits\CircuitPersistenceManagerTest.cs (1)
429scope.ServiceProvider,
Microsoft.AspNetCore.Components.Tests (24)
PersistentState\PersistentServicesRegistryTest.cs (24)
24var scope = serviceProvider.CreateAsyncScope().ServiceProvider; 41var secondScope = serviceProvider.CreateAsyncScope().ServiceProvider; 69var scope = serviceProviderOne.CreateAsyncScope().ServiceProvider; 83var scopeTwo = serviceProviderTwo.CreateAsyncScope().ServiceProvider; 111serviceProvider.CreateAsyncScope().ServiceProvider); 119serviceProvider.CreateAsyncScope().ServiceProvider); 138var scope = serviceProvider.CreateAsyncScope().ServiceProvider; 168var scope = serviceProviderOne.CreateAsyncScope().ServiceProvider; 183var scopeTwo = serviceProviderTwo.CreateAsyncScope().ServiceProvider; 208var scope = serviceProviderOne.CreateAsyncScope().ServiceProvider; 222var scopeTwo = serviceProviderTwo.CreateAsyncScope().ServiceProvider; 246var scope = serviceProviderOne.CreateAsyncScope().ServiceProvider; 256var scopeTwo = serviceProviderTwo.CreateAsyncScope().ServiceProvider; 322var scope = serviceProvider.CreateAsyncScope().ServiceProvider; 338var secondScope = serviceProvider.CreateAsyncScope().ServiceProvider; 371var scope = serviceProvider.CreateAsyncScope().ServiceProvider; 384var secondScope = serviceProvider.CreateAsyncScope().ServiceProvider; 412var scope = serviceProvider.CreateAsyncScope().ServiceProvider; 426var initialValueScope = serviceProvider.CreateAsyncScope().ServiceProvider; 448var scope = serviceProvider.CreateAsyncScope().ServiceProvider; 462var lastSnapshotScope = serviceProvider.CreateAsyncScope().ServiceProvider; 484var scope = serviceProvider.CreateAsyncScope().ServiceProvider; 498var updatedScope = serviceProvider.CreateAsyncScope().ServiceProvider; 511var targetScope = serviceProvider.CreateAsyncScope().ServiceProvider;
Microsoft.AspNetCore.Components.WebAssembly (1)
Hosting\WebAssemblyHost.cs (1)
66public IServiceProvider Services => _scope.ServiceProvider;
Microsoft.AspNetCore.Components.WebView (1)
PageContext.cs (1)
29public IServiceProvider ServiceProvider => _serviceScope.ServiceProvider;
Microsoft.AspNetCore.Diagnostics (2)
ExceptionHandler\ExceptionHandlerMiddlewareImpl.cs (1)
152context.RequestServices = scope.Value.ServiceProvider;
StatusCodePage\StatusCodePagesExtensions.cs (1)
243context.HttpContext.RequestServices = scope.Value.ServiceProvider;
Microsoft.AspNetCore.Http.Connections (1)
Internal\HttpConnectionDispatcher.cs (1)
765newHttpContext.RequestServices = connection.ServiceScope.Value.ServiceProvider;
Microsoft.AspNetCore.Http.Connections.Tests (1)
HttpConnectionDispatcherTests.cs (1)
3089Assert.Throws<ObjectDisposedException>(() => connection.ServiceScope.Value.ServiceProvider.GetService<MessageWrapper>());
Microsoft.AspNetCore.Mvc.FunctionalTests (1)
TestingInfrastructureInheritanceTests.cs (1)
89var sink = scope.ServiceProvider.GetRequiredService<DisposableService>();
Microsoft.AspNetCore.SignalR.Core (13)
Internal\DefaultHubDispatcher.cs (13)
87var hubActivator = scope.ServiceProvider.GetRequiredService<IHubActivator<THub>>(); 95activity = StartActivity(SignalRServerActivitySource.OnConnected, ActivityKind.Internal, linkedActivity: null, scope.ServiceProvider, nameof(hub.OnConnectedAsync), headers: null, _logger); 99var context = new HubLifetimeContext(connection.HubCallerContext, scope.ServiceProvider, hub); 123var hubActivator = scope.ServiceProvider.GetRequiredService<IHubActivator<THub>>(); 130activity = StartActivity(SignalRServerActivitySource.OnDisconnected, ActivityKind.Internal, linkedActivity: null, scope.ServiceProvider, nameof(hub.OnDisconnectedAsync), headers: null, _logger); 134var context = new HubLifetimeContext(connection.HubCallerContext, scope.ServiceProvider, hub); 330hubActivator = scope.ServiceProvider.GetRequiredService<IHubActivator<THub>>(); 333if (!await IsHubMethodAuthorized(scope.ServiceProvider, connection, descriptor, hubMethodInvocationMessage.Arguments, hub)) 407var activity = StartActivity(SignalRServerActivitySource.InvocationIn, ActivityKind.Server, connection.OriginalActivity, scope.ServiceProvider, hubMethodInvocationMessage.Target, hubMethodInvocationMessage.Headers, logger); 412result = await dispatcher.ExecuteHubMethod(methodExecutor, hub, arguments, connection, scope.ServiceProvider); 525var activity = StartActivity(SignalRServerActivitySource.InvocationIn, ActivityKind.Server, connection.OriginalActivity, scope.ServiceProvider, hubMethodInvocationMessage.Target, hubMethodInvocationMessage.Headers, _logger); 539result = await ExecuteHubMethod(descriptor.MethodExecutor, hub, arguments, connection, scope.ServiceProvider); 732arguments[parameterPointer] = descriptor.GetService(scope.ServiceProvider, parameterPointer, descriptor.OriginalParameterTypes[parameterPointer]);
Microsoft.Extensions.Diagnostics.HealthChecks (1)
DefaultHealthCheckService.cs (1)
81var healthCheck = registration.Factory(scope.ServiceProvider);