8 implementations of IServiceScope
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)
543internal class AsyncServiceScope : IServiceScope, IAsyncDisposable
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
Microsoft.Extensions.DependencyInjection.Abstractions (1)
AsyncServiceScope.cs (1)
14public readonly struct AsyncServiceScope : IServiceScope, IAsyncDisposable
101 references to IServiceScope
Aspire.Components.Common.Tests (2)
ConformanceTests.cs (2)
178using (IServiceScope scope1 = host.Services.CreateScope()) 183using (IServiceScope scope2 = host.Services.CreateScope())
CatalogDb (1)
CatalogDbInitializer.cs (1)
15using var scope = serviceProvider.CreateScope();
DatabaseMigration.MigrationService (1)
ApiDbInitializer.cs (1)
26using var scope = serviceProvider.CreateScope();
Microsoft.AspNetCore.Components.Endpoints.Tests (1)
EndpointHtmlRendererTest.cs (1)
671var scope = provider.GetRequiredService<IServiceScopeFactory>().CreateScope();
Microsoft.AspNetCore.Components.Server.Tests (9)
Circuits\CircuitHostTest.cs (6)
28var serviceScope = new Mock<IServiceScope>(); 47var serviceScope = new Mock<IServiceScope>(); 73var serviceScope = new Mock<IServiceScope>(); 100var serviceScope = new Mock<IServiceScope>(); 130var serviceScope = new Mock<IServiceScope>(); 220var serviceScope = new Mock<IServiceScope>();
Circuits\ComponentHubTest.cs (2)
158var serviceScope = new Mock<IServiceScope>(); 208var serviceScope = new Mock<IServiceScope>();
Circuits\TestCircuitHost.cs (1)
29serviceScope = serviceScope ?? new AsyncServiceScope(Mock.Of<IServiceScope>());
Microsoft.AspNetCore.DataProtection.EntityFrameworkCore (2)
EntityFrameworkCoreXmlRepository.cs (2)
48using (var scope = _services.CreateScope()) 68using (var scope = _services.CreateScope())
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (2)
Latency\RequestLatencyTelemetryExtensionsTests.cs (2)
40using var scope1 = serviceProvider.CreateScope(); 41using var scope2 = serviceProvider.CreateScope();
Microsoft.AspNetCore.Hosting (1)
Internal\ConfigureBuilder.cs (1)
26using (var scope = builder.ApplicationServices.CreateScope())
Microsoft.AspNetCore.Http (1)
Features\RequestServicesFeature.cs (1)
15private IServiceScope? _scope;
Microsoft.AspNetCore.Http.Extensions.Tests (3)
RequestDelegateFactoryTests.cs (2)
1179using var requestScoped = services.CreateScope(); 3680public IServiceScope CreateScope()
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
447public IServiceScope CreateScope()
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
447public IServiceScope CreateScope()
Microsoft.AspNetCore.Http.Tests (3)
DefaultHttpContextTests.cs (3)
536public IServiceScope CreateScope() 545private readonly IServiceScope _scope; 547public AsyncServiceScope(IServiceScope scope)
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (20)
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())
UserStoreEncryptPersonalDataTest.cs (1)
194using (var scope = applicationServiceProvider.CreateScope())
UserStoreGuidKeyTest.cs (2)
64using (var csope = sp.CreateScope()) 81using (var csope = sp.CreateScope())
UserStoreIntKeyTest.cs (2)
42using (var csope = sp.CreateScope()) 59using (var csope = sp.CreateScope())
UserStoreStringKeyTest.cs (2)
43using (var csope = sp.CreateScope()) 60using (var csope = sp.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.Identity.FunctionalTests (1)
Infrastructure\ServerFactory.cs (1)
75using (var scope = services.CreateScope())
Microsoft.AspNetCore.Mvc.FunctionalTests (1)
TestingInfrastructureInheritanceTests.cs (1)
101using var scope = factory.Services.CreateScope();
Microsoft.AspNetCore.Mvc.Test (1)
MvcServiceCollectionExtensionsTest.cs (1)
416using (var scope = scopeFactory.CreateScope())
Microsoft.AspNetCore.OpenApi (1)
Services\OpenApiDocumentProvider.cs (1)
47using var scopedService = serviceProvider.CreateScope();
Microsoft.AspNetCore.OpenApi.Tests (5)
Integration\OpenApiDocumentIntegrationTests.cs (1)
24var scopedServiceProvider = fixture.Services.CreateScope();
Services\OpenApiDocumentServiceTestsBase.cs (4)
37var scopedService = ((TestServiceProvider)builder.ServiceProvider).CreateScope(); 46var scopedService = ((TestServiceProvider)builder.ServiceProvider).CreateScope(); 272public IServiceScope CreateScope() 274var scope = _serviceProvider.CreateScope();
Microsoft.AspNetCore.Routing.Tests (1)
Builder\RouteHandlerEndpointRouteBuilderExtensionsTest.cs (1)
1164public IServiceScope CreateScope()
Microsoft.AspNetCore.SignalR.Core (1)
Internal\DefaultHubDispatcher.cs (1)
772using var scope = _serviceScopeFactory.CreateScope();
Microsoft.Extensions.DependencyInjection (5)
ServiceLookup\CallSiteValidator.cs (2)
17public void ValidateResolution(ServiceCallSite callSite, IServiceScope scope, IServiceScope rootScope)
ServiceLookup\ServiceProviderEngineScope.cs (1)
75public IServiceScope CreateScope() => RootProvider.CreateScope();
ServiceProvider.cs (2)
164private void OnResolve(ServiceCallSite? callSite, IServiceScope scope) 237internal IServiceScope CreateScope()
Microsoft.Extensions.DependencyInjection.Abstractions (14)
AsyncServiceScope.cs (5)
11/// An <see cref="IServiceScope" /> implementation that implements <see cref="IAsyncDisposable" />. 16private readonly IServiceScope _serviceScope; 20/// Wraps an instance of <see cref="IServiceScope" />. 22/// <param name="serviceScope">The <see cref="IServiceScope"/> instance to wrap.</param> 23public AsyncServiceScope(IServiceScope serviceScope)
IServiceScope.cs (1)
14/// <see cref="Microsoft.Extensions.DependencyInjection.IServiceScope.ServiceProvider"/> will be
IServiceScopeFactory.cs (5)
7/// Creates instances of <see cref="IServiceScope"/>, which is used to create 13/// Create an <see cref="Microsoft.Extensions.DependencyInjection.IServiceScope"/> that 18/// An <see cref="Microsoft.Extensions.DependencyInjection.IServiceScope"/> controlling the 20/// from the <see cref="Microsoft.Extensions.DependencyInjection.IServiceScope.ServiceProvider"/> 23IServiceScope CreateScope();
ServiceProviderServiceExtensions.cs (3)
98/// Creates a new <see cref="IServiceScope"/> that can be used to resolve scoped services. 101/// <returns>A <see cref="IServiceScope"/> that can be used to resolve scoped services.</returns> 102public static IServiceScope CreateScope(this IServiceProvider provider)
Microsoft.Extensions.Http (5)
ActiveHandlerTrackingEntry.cs (2)
25IServiceScope? scope, 42public IServiceScope? Scope { get; }
DefaultHttpClientFactory.cs (2)
134var scope = (IServiceScope?)null;
ExpiredHandlerTrackingEntry.cs (1)
32public IServiceScope? Scope { get; }
Microsoft.Extensions.ObjectPool.DependencyInjection.Tests (5)
DependencyInjectionExtensionsTests.cs (5)
238using (var scope = provider.CreateScope()) 272var scope1 = provider.CreateScope(); 276var scope2 = provider.CreateScope(); 329var scope1 = provider.CreateScope(); 333var scope2 = provider.CreateScope();
Microsoft.Extensions.Telemetry.Abstractions.Tests (2)
Latency\NoopLatencyContextTests.cs (2)
38var scope1 = serviceProvider.CreateScope(); 39var scope2 = serviceProvider.CreateScope();
Microsoft.Extensions.Telemetry.Tests (10)
Latency\Internal\LatencyContextTests.cs (8)
77using var scope = new ServiceCollection() 103using var scope = new ServiceCollection() 129using var scope = new ServiceCollection() 156using var scope = new ServiceCollection() 187using var scope = new ServiceCollection() 214using var scope = new ServiceCollection() 239using var scope = new ServiceCollection() 264using var scope = new ServiceCollection()
Latency\LatencyContextExtensionTests.cs (2)
47var scope1 = serviceProvider.CreateScope(); 48var scope2 = serviceProvider.CreateScope();
SqlServerEndToEnd.DbSetup (1)
Program.cs (1)
11using var scope = app.Services.CreateScope();
WaitForSandbox.DbSetup (1)
Program.cs (1)
9using var scope = app.Services.CreateScope();