7 implementations of IServiceScope
Microsoft.AspNetCore.Http.Extensions.Tests (2)
RequestDelegateFactoryTests.cs (1)
3670private class EmptyServiceProvider : IServiceScope, IServiceProvider, IServiceScopeFactory
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
442private class EmptyServiceProvider : IServiceScope, IServiceProvider, IServiceScopeFactory, IServiceProviderIsService
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
442private class EmptyServiceProvider : IServiceScope, IServiceProvider, IServiceScopeFactory, IServiceProviderIsService
Microsoft.AspNetCore.Http.Tests (1)
DefaultHttpContextTests.cs (1)
543internal class AsyncServiceScope : IServiceScope, IAsyncDisposable
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
73 references to IServiceScope
Aspire.Components.Common.Tests (2)
ConformanceTests.cs (2)
175using (IServiceScope scope1 = host.Services.CreateScope()) 180using (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.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(); 3674public IServiceScope CreateScope()
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
446public IServiceScope CreateScope()
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
446public 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.Test (1)
MvcServiceCollectionExtensionsTest.cs (1)
416using (var scope = scopeFactory.CreateScope())
Microsoft.AspNetCore.Routing.Tests (1)
Builder\RouteHandlerEndpointRouteBuilderExtensionsTest.cs (1)
1164public IServiceScope CreateScope()
Microsoft.AspNetCore.SignalR.Core (1)
Internal\DefaultHubDispatcher.cs (1)
747using 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)
162private void OnResolve(ServiceCallSite? callSite, IServiceScope scope) 235internal 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)
11/// <see cref="Microsoft.Extensions.DependencyInjection.IServiceScope.ServiceProvider"/> will be
IServiceScopeFactory.cs (5)
7/// A factory for creating instances of <see cref="IServiceScope"/>, which is used to create 13/// Create an <see cref="Microsoft.Extensions.DependencyInjection.IServiceScope"/> which 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; }