2 implementations of IServiceScope
Microsoft.Extensions.DependencyInjection (1)
ServiceLookup\ServiceProviderEngineScope.cs (1)
16internal sealed class ServiceProviderEngineScope : IServiceScope, IServiceProvider, IKeyedServiceProvider, IAsyncDisposable, IServiceScopeFactory
Microsoft.Extensions.DependencyInjection.Abstractions (1)
AsyncServiceScope.cs (1)
14public readonly struct AsyncServiceScope : IServiceScope, IAsyncDisposable
79 references to IServiceScope
Aspire.Azure.Npgsql.EntityFrameworkCore.PostgreSQL.Tests (1)
TokenCredentialTests.cs (1)
83using var scope = host.Services.CreateScope();
Aspire.Components.Common.TestUtilities (2)
ConformanceTests.cs (2)
213using (IServiceScope scope1 = host.Services.CreateScope()) 218using (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.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.SignalR.Core (1)
Internal\DefaultHubDispatcher.cs (1)
770using var scope = _serviceScopeFactory.CreateScope();
Microsoft.Extensions.AI.Tests (24)
ChatCompletion\DependencyInjectionPatterns.cs (8)
23using var scope1 = services.CreateScope(); 24using var scope2 = services.CreateScope(); 47using var scope1 = services.CreateScope(); 48using var scope2 = services.CreateScope(); 70using var scope1 = services.CreateScope(); 71using var scope2 = services.CreateScope(); 96using var scope1 = services.CreateScope(); 97using var scope2 = services.CreateScope();
Image\ImageGeneratorDependencyInjectionPatterns.cs (8)
23using var scope1 = services.CreateScope(); 24using var scope2 = services.CreateScope(); 47using var scope1 = services.CreateScope(); 48using var scope2 = services.CreateScope(); 70using var scope1 = services.CreateScope(); 71using var scope2 = services.CreateScope(); 96using var scope1 = services.CreateScope(); 97using var scope2 = services.CreateScope();
SpeechToText\SpeechToTextClientDependencyInjectionPatterns.cs (8)
23using var scope1 = services.CreateScope(); 24using var scope2 = services.CreateScope(); 47using var scope1 = services.CreateScope(); 48using var scope2 = services.CreateScope(); 70using var scope1 = services.CreateScope(); 71using var scope2 = services.CreateScope(); 96using var scope1 = services.CreateScope(); 97using var scope2 = services.CreateScope();
Microsoft.Extensions.DependencyInjection (5)
ServiceLookup\CallSiteValidator.cs (2)
17public void ValidateResolution(ServiceCallSite callSite, IServiceScope scope, IServiceScope rootScope)
ServiceLookup\ServiceProviderEngineScope.cs (1)
76public IServiceScope CreateScope() => RootProvider.CreateScope();
ServiceProvider.cs (2)
214private void OnResolve(ServiceCallSite? callSite, IServiceScope scope) 287internal 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 21/// <see cref="Microsoft.Extensions.DependencyInjection.IServiceScope.ServiceProvider"/> will also be disposed. 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();
Microsoft.Maui (1)
MauiContextExtensions.cs (1)
47 public static IMauiContext MakeWindowScope(this IMauiContext mauiContext, NativeWindow platformWindow, out IServiceScope scope)
Publishers.DbSetup (1)
Program.cs (1)
9using var scope = app.Services.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();