77 references to Scoped
Aspire.Components.Common.TestUtilities (1)
ConformanceTests.cs (1)
235case ServiceLifetime.Scoped:
Aspire.Microsoft.Data.SqlClient.Tests (1)
ConformanceTests.cs (1)
19protected override ServiceLifetime ServiceLifetime => ServiceLifetime.Scoped;
Microsoft.AspNetCore.Components.WebView.Test (2)
ComponentsWebViewServiceCollectionExtensionsTests.cs (2)
46Assert.Equal(ServiceLifetime.Scoped, persistenceManagerDescriptor.Lifetime); 47Assert.Equal(ServiceLifetime.Scoped, persistentStateDescriptor.Lifetime);
Microsoft.AspNetCore.Identity.FunctionalTests (1)
Infrastructure\FunctionalTestsServiceCollectionExtensions.cs (1)
24ServiceLifetime.Scoped);
Microsoft.DotNet.Internal.DependencyInjection.Testing (2)
DependencyInjectionValidation.cs (2)
70if (!IsTypeResolvable(scopedType, services, allErrors, ServiceLifetime.Scoped)) 149parameterService.Lifetime == ServiceLifetime.Scoped)
Microsoft.Extensions.AI.Tests (10)
ChatCompletion\DependencyInjectionPatterns.cs (6)
115[InlineData(ServiceLifetime.Scoped)] 137[InlineData(ServiceLifetime.Scoped)] 160[InlineData(ServiceLifetime.Scoped)] 183[InlineData(ServiceLifetime.Scoped)] 205[InlineData(ServiceLifetime.Scoped)] 229[InlineData(ServiceLifetime.Scoped)]
Image\ImageGeneratorDependencyInjectionPatterns.cs (2)
115[InlineData(ServiceLifetime.Scoped)] 137[InlineData(ServiceLifetime.Scoped)]
SpeechToText\SpeechToTextClientDependencyInjectionPatterns.cs (2)
115[InlineData(ServiceLifetime.Scoped)] 137[InlineData(ServiceLifetime.Scoped)]
Microsoft.Extensions.Caching.SqlServer.Tests (1)
SqlServerCacheServicesExtensionsTest.cs (1)
51Assert.Equal(ServiceLifetime.Scoped, distributedCache.Lifetime);
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (2)
CacheServiceExtensionsTests.cs (2)
56Assert.Equal(ServiceLifetime.Scoped, distributedCache.Lifetime); 127Assert.Equal(ServiceLifetime.Scoped, distributedCache.Lifetime);
Microsoft.Extensions.DependencyInjection (5)
DependencyInjectionEventSource.cs (1)
222case ServiceLifetime.Scoped:
ServiceLookup\CallSiteValidator.cs (3)
28nameof(ServiceLifetime.Scoped).ToLowerInvariant())); 35nameof(ServiceLifetime.Scoped).ToLowerInvariant())); 59nameof(ServiceLifetime.Scoped).ToLowerInvariant(),
ServiceLookup\ResultCache.cs (1)
30case ServiceLifetime.Scoped:
Microsoft.Extensions.DependencyInjection.Abstractions (50)
Extensions\ServiceCollectionDescriptorExtensions.cs (6)
212/// Adds the specified <paramref name="service"/> as a <see cref="ServiceLifetime.Scoped"/> service 230/// Adds the specified <paramref name="service"/> as a <see cref="ServiceLifetime.Scoped"/> service 252/// Adds the specified <paramref name="service"/> as a <see cref="ServiceLifetime.Scoped"/> service 274/// Adds the specified <typeparamref name="TService"/> as a <see cref="ServiceLifetime.Scoped"/> service 289/// Adds the specified <typeparamref name="TService"/> as a <see cref="ServiceLifetime.Scoped"/> service 307/// Adds the specified <typeparamref name="TService"/> as a <see cref="ServiceLifetime.Scoped"/> service
Extensions\ServiceCollectionDescriptorExtensions.Keyed.cs (6)
135/// Adds the specified <paramref name="service"/> as a <see cref="ServiceLifetime.Scoped"/> service 155/// Adds the specified <paramref name="service"/> as a <see cref="ServiceLifetime.Scoped"/> service 179/// Adds the specified <paramref name="service"/> as a <see cref="ServiceLifetime.Scoped"/> service 203/// Adds the specified <typeparamref name="TService"/> as a <see cref="ServiceLifetime.Scoped"/> service 219/// Adds the specified <typeparamref name="TService"/> as a <see cref="ServiceLifetime.Scoped"/> service 238/// Adds the specified <typeparamref name="TService"/> as a <see cref="ServiceLifetime.Scoped"/> service
ServiceCollectionServiceExtensions.cs (9)
205/// <seealso cref="ServiceLifetime.Scoped"/> 215return Add(services, serviceType, implementationType, ServiceLifetime.Scoped); 232/// <seealso cref="ServiceLifetime.Scoped"/> 242return Add(services, serviceType, implementationFactory, ServiceLifetime.Scoped); 259/// <seealso cref="ServiceLifetime.Scoped"/> 281/// <seealso cref="ServiceLifetime.Scoped"/> 304/// <seealso cref="ServiceLifetime.Scoped"/> 327/// <seealso cref="ServiceLifetime.Scoped"/> 355/// <seealso cref="ServiceLifetime.Scoped"/>
ServiceCollectionServiceExtensions.Keyed.cs (9)
222/// <seealso cref="ServiceLifetime.Scoped"/> 233return AddKeyed(services, serviceType, serviceKey, implementationType, ServiceLifetime.Scoped); 251/// <seealso cref="ServiceLifetime.Scoped"/> 262return AddKeyed(services, serviceType, serviceKey, implementationFactory, ServiceLifetime.Scoped); 280/// <seealso cref="ServiceLifetime.Scoped"/> 305/// <seealso cref="ServiceLifetime.Scoped"/> 330/// <seealso cref="ServiceLifetime.Scoped"/> 356/// <seealso cref="ServiceLifetime.Scoped"/> 386/// <seealso cref="ServiceLifetime.Scoped"/>
ServiceDescriptor.cs (20)
533/// and the <see cref="ServiceLifetime.Scoped"/> lifetime. 542return DescribeKeyed<TService, TImplementation>(null, ServiceLifetime.Scoped); 548/// and the <see cref="ServiceLifetime.Scoped"/> lifetime. 558return DescribeKeyed<TService, TImplementation>(serviceKey, ServiceLifetime.Scoped); 564/// and the <see cref="ServiceLifetime.Scoped"/> lifetime. 573return Describe(service, implementationType, ServiceLifetime.Scoped); 579/// and the <see cref="ServiceLifetime.Scoped"/> lifetime. 590return DescribeKeyed(service, serviceKey, implementationType, ServiceLifetime.Scoped); 597/// and the <see cref="ServiceLifetime.Scoped"/> lifetime. 610return Describe(typeof(TService), implementationFactory, ServiceLifetime.Scoped); 617/// and the <see cref="ServiceLifetime.Scoped"/> lifetime. 632return DescribeKeyed(typeof(TService), serviceKey, implementationFactory, ServiceLifetime.Scoped); 638/// and the <see cref="ServiceLifetime.Scoped"/> lifetime. 648return Describe(typeof(TService), implementationFactory, ServiceLifetime.Scoped); 654/// and the <see cref="ServiceLifetime.Scoped"/> lifetime. 665return DescribeKeyed(typeof(TService), serviceKey, implementationFactory, ServiceLifetime.Scoped); 671/// and the <see cref="ServiceLifetime.Scoped"/> lifetime. 681return Describe(service, implementationFactory, ServiceLifetime.Scoped); 687/// and the <see cref="ServiceLifetime.Scoped"/> lifetime. 698return DescribeKeyed(service, serviceKey, implementationFactory, ServiceLifetime.Scoped);
Microsoft.Extensions.Http (2)
DependencyInjection\HttpClientBuilderExtensions.cs (2)
652/// By default, the lifetime is <see cref="ServiceLifetime.Scoped"/>. 687public static IHttpClientBuilder AddAsKeyed(this IHttpClientBuilder builder, ServiceLifetime lifetime = ServiceLifetime.Scoped)