7 implementations of IServiceScopeFactory
Microsoft.AspNetCore.Http.Extensions.Tests (2)
RequestDelegateFactoryTests.cs (1)
3676private class EmptyServiceProvider : IServiceScope, IServiceProvider, IServiceScopeFactory
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
443private class EmptyServiceProvider : IServiceScope, IServiceProvider, IServiceScopeFactory, IServiceProviderIsService
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
443private class EmptyServiceProvider : IServiceScope, IServiceProvider, IServiceScopeFactory, IServiceProviderIsService
Microsoft.AspNetCore.Http.Tests (1)
DefaultHttpContextTests.cs (1)
510private class AsyncDisposableServiceProvider : IServiceProvider, IDisposable, IServiceScopeFactory
Microsoft.AspNetCore.OpenApi.Tests (1)
Services\OpenApiDocumentServiceTestsBase.cs (1)
252private class TestServiceProvider : IServiceProvider, IKeyedServiceProvider, IServiceScope, IServiceScopeFactory
Microsoft.AspNetCore.Routing.Tests (1)
Builder\RouteHandlerEndpointRouteBuilderExtensionsTest.cs (1)
1158private class EmptyServiceProvider : IServiceScope, IServiceProvider, IServiceScopeFactory
Microsoft.Extensions.DependencyInjection (1)
ServiceLookup\ServiceProviderEngineScope.cs (1)
15internal sealed class ServiceProviderEngineScope : IServiceScope, IServiceProvider, IKeyedServiceProvider, IAsyncDisposable, IServiceScopeFactory
62 references to IServiceScopeFactory
Microsoft.AspNetCore.Components (1)
OwningComponentBase.cs (1)
21[Inject] IServiceScopeFactory ScopeFactory { get; set; } = default!;
Microsoft.AspNetCore.Components.Endpoints.Tests (1)
EndpointHtmlRendererTest.cs (1)
671var scope = provider.GetRequiredService<IServiceScopeFactory>().CreateScope();
Microsoft.AspNetCore.Components.Server (2)
Circuits\CircuitFactory.cs (2)
18private readonly IServiceScopeFactory _scopeFactory; 25IServiceScopeFactory scopeFactory,
Microsoft.AspNetCore.Components.Server.Tests (2)
Circuits\ComponentHubTest.cs (2)
108new Mock<IServiceScopeFactory>().Object, 191IServiceScopeFactory scopeFactory,
Microsoft.AspNetCore.Components.WebAssembly (1)
Hosting\WebAssemblyHostBuilder.cs (1)
292var scope = services.GetRequiredService<IServiceScopeFactory>().CreateAsyncScope();
Microsoft.AspNetCore.Diagnostics (1)
ExceptionHandler\ExceptionHandlerMiddlewareImpl.cs (1)
147await using AsyncServiceScope? scope = _options.CreateScopeForErrors ? context.RequestServices.GetRequiredService<IServiceScopeFactory>().CreateAsyncScope() : null;
Microsoft.AspNetCore.Hosting (2)
Http\DefaultHttpContextFactory.cs (2)
21private readonly IServiceScopeFactory _serviceScopeFactory; 34_serviceScopeFactory = serviceProvider.GetRequiredService<IServiceScopeFactory>();
Microsoft.AspNetCore.Hosting.Tests (1)
Http\DefaultHttpContextFactoryTests.cs (1)
80Assert.Same(services.GetRequiredService<IServiceScopeFactory>(), context.ServiceScopeFactory);
Microsoft.AspNetCore.Http (6)
DefaultHttpContext.cs (3)
110/// Gets or sets the <see cref="IServiceScopeFactory" /> for this instance. 113/// <see cref="IServiceScopeFactory"/> 115public IServiceScopeFactory ServiceScopeFactory { get; set; } = default!;
Features\RequestServicesFeature.cs (3)
13private readonly IServiceScopeFactory? _scopeFactory; 23/// <param name="scopeFactory">The <see cref="IServiceScopeFactory"/>.</param> 24public RequestServicesFeature(HttpContext context, IServiceScopeFactory? scopeFactory)
Microsoft.AspNetCore.Http.Extensions.Tests (2)
RequestDelegateFactoryTests.cs (1)
3692if (serviceType == typeof(IServiceScopeFactory))
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
466serviceType == typeof(IServiceScopeFactory) ||
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
466serviceType == typeof(IServiceScopeFactory) ||
Microsoft.AspNetCore.Http.Tests (8)
DefaultHttpContextTests.cs (8)
194var scopeFactory = serviceProvider.GetRequiredService<IServiceScopeFactory>(); 210var scopeFactory = serviceProvider.GetRequiredService<IServiceScopeFactory>(); 237var scopeFactory = serviceProvider.GetRequiredService<IServiceScopeFactory>(); 523if (serviceType == typeof(IServiceScopeFactory)) 538var scope = new AsyncServiceScope(_serviceProvider.GetService<IServiceScopeFactory>().CreateScope());
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (13)
CustomSchemaTest.cs (2)
34using var scope = _builder.ApplicationServices.GetRequiredService<IServiceScopeFactory>().CreateScope(); 42using var scope = _builder.ApplicationServices.GetRequiredService<IServiceScopeFactory>().CreateScope();
DefaultPocoTest.cs (1)
35using (var scoped = provider.GetRequiredService<IServiceScopeFactory>().CreateScope())
EmptySchemaTest.cs (2)
34using var scope = _builder.ApplicationServices.GetRequiredService<IServiceScopeFactory>().CreateScope(); 42using var scope = _builder.ApplicationServices.GetRequiredService<IServiceScopeFactory>().CreateScope();
MaxKeyLengthSchemaTest.cs (2)
34using (var scope = _builder.ApplicationServices.GetRequiredService<IServiceScopeFactory>().CreateScope()) 52using (var scope = _builder.ApplicationServices.GetRequiredService<IServiceScopeFactory>().CreateScope())
UserOnlyCustomContextTest.cs (1)
79using (var scoped = provider.GetRequiredService<IServiceScopeFactory>().CreateScope())
UserOnlyTest.cs (1)
40using (var scoped = provider.GetRequiredService<IServiceScopeFactory>().CreateScope())
VersionOneSchemaTest.cs (2)
36using var scope = _builder.ApplicationServices.GetRequiredService<IServiceScopeFactory>().CreateScope(); 44using var scope = _builder.ApplicationServices.GetRequiredService<IServiceScopeFactory>().CreateScope();
VersionTwoSchemaTest.cs (2)
36var scope = _builder.ApplicationServices.GetRequiredService<IServiceScopeFactory>().CreateScope(); 44using var scope = _builder.ApplicationServices.GetRequiredService<IServiceScopeFactory>().CreateScope();
Microsoft.AspNetCore.Mvc.Test (2)
MvcServiceCollectionExtensionsTest.cs (2)
413var scopeFactory = root.GetRequiredService<IServiceScopeFactory>();
Microsoft.AspNetCore.Routing.Tests (1)
Builder\RouteHandlerEndpointRouteBuilderExtensionsTest.cs (1)
1175if (serviceType == typeof(IServiceScopeFactory))
Microsoft.AspNetCore.SignalR.Core (3)
HubConnectionHandler.cs (1)
55IServiceScopeFactory serviceScopeFactory
Internal\DefaultHubDispatcher.cs (2)
27private readonly IServiceScopeFactory _serviceScopeFactory; 42public DefaultHubDispatcher(IServiceScopeFactory serviceScopeFactory, IHubContext<THub> hubContext, bool enableDetailedErrors,
Microsoft.AspNetCore.SignalR.Microbenchmarks (2)
DefaultHubDispatcherBenchmark.cs (2)
30var serviceScopeFactory = provider.GetService<IServiceScopeFactory>();
Microsoft.Extensions.DependencyInjection (4)
ServiceLookup\CallSiteFactory.cs (1)
691serviceType == typeof(IServiceScopeFactory) ||
ServiceLookup\CallSiteValidator.cs (1)
99if (scopedCallSite.ServiceType == typeof(IServiceScopeFactory))
ServiceProvider.cs (2)
64CallSiteFactory.Add(ServiceIdentifier.FromServiceType(typeof(IServiceScopeFactory)), new ConstantCallSite(typeof(IServiceScopeFactory), Root));
Microsoft.Extensions.DependencyInjection.Abstractions (3)
ServiceProviderServiceExtensions.cs (3)
104return provider.GetRequiredService<IServiceScopeFactory>().CreateScope(); 120/// <param name="serviceScopeFactory">The <see cref="IServiceScopeFactory"/> to create the scope from.</param> 122public static AsyncServiceScope CreateAsyncScope(this IServiceScopeFactory serviceScopeFactory)
Microsoft.Extensions.Diagnostics.HealthChecks (2)
DefaultHealthCheckService.cs (2)
20private readonly IServiceScopeFactory _scopeFactory; 25IServiceScopeFactory scopeFactory,
Microsoft.Extensions.Diagnostics.HealthChecks.Tests (2)
DefaultHealthCheckServiceTest.cs (2)
42var scopeFactory = services.GetRequiredService<IServiceScopeFactory>();
Microsoft.Extensions.Http (2)
DefaultHttpClientFactory.cs (2)
23private readonly IServiceScopeFactory _scopeFactory; 64IServiceScopeFactory scopeFactory,