73 references to Scoped
Aspire.Components.Common.Tests (1)
ConformanceTests.cs (1)
209
case ServiceLifetime.
Scoped
:
Aspire.Microsoft.Data.SqlClient.Tests (1)
ConformanceTests.cs (1)
20
protected override ServiceLifetime ServiceLifetime => ServiceLifetime.
Scoped
;
Microsoft.AspNetCore.Identity.FunctionalTests (1)
Infrastructure\FunctionalTestsServiceCollectionExtensions.cs (1)
24
ServiceLifetime.
Scoped
);
Microsoft.DotNet.Internal.DependencyInjection.Testing (2)
DependencyInjectionValidation.cs (2)
70
if (!IsTypeResolvable(scopedType, services, allErrors, ServiceLifetime.
Scoped
))
149
parameterService.Lifetime == ServiceLifetime.
Scoped
)
Microsoft.Extensions.AI.Tests (8)
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
)]
SpeechToText\SpeechToTextClientDependencyInjectionPatterns.cs (2)
115
[InlineData(ServiceLifetime.
Scoped
)]
137
[InlineData(ServiceLifetime.
Scoped
)]
Microsoft.Extensions.Caching.SqlServer.Tests (1)
SqlServerCacheServicesExtensionsTest.cs (1)
51
Assert.Equal(ServiceLifetime.
Scoped
, distributedCache.Lifetime);
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (2)
CacheServiceExtensionsTests.cs (2)
56
Assert.Equal(ServiceLifetime.
Scoped
, distributedCache.Lifetime);
127
Assert.Equal(ServiceLifetime.
Scoped
, distributedCache.Lifetime);
Microsoft.Extensions.DependencyInjection (5)
DependencyInjectionEventSource.cs (1)
201
case ServiceLifetime.
Scoped
:
ServiceLookup\CallSiteValidator.cs (3)
28
nameof(ServiceLifetime.
Scoped
).ToLowerInvariant()));
35
nameof(ServiceLifetime.
Scoped
).ToLowerInvariant()));
59
nameof(ServiceLifetime.
Scoped
).ToLowerInvariant(),
ServiceLookup\ResultCache.cs (1)
30
case ServiceLifetime.
Scoped
:
Microsoft.Extensions.DependencyInjection.Abstractions (50)
Extensions\ServiceCollectionDescriptorExtensions.cs (6)
206
/// Adds the specified <paramref name="service"/> as a <see cref="ServiceLifetime.
Scoped
"/> service
223
/// Adds the specified <paramref name="service"/> as a <see cref="ServiceLifetime.
Scoped
"/> service
244
/// Adds the specified <paramref name="service"/> as a <see cref="ServiceLifetime.
Scoped
"/> service
265
/// Adds the specified <typeparamref name="TService"/> as a <see cref="ServiceLifetime.
Scoped
"/> service
279
/// Adds the specified <typeparamref name="TService"/> as a <see cref="ServiceLifetime.
Scoped
"/> service
296
/// Adds the specified <typeparamref name="TService"/> as a <see cref="ServiceLifetime.
Scoped
"/> service
Extensions\ServiceCollectionDescriptorExtensions.Keyed.cs (6)
129
/// Adds the specified <paramref name="service"/> as a <see cref="ServiceLifetime.
Scoped
"/> service
148
/// Adds the specified <paramref name="service"/> as a <see cref="ServiceLifetime.
Scoped
"/> service
171
/// Adds the specified <paramref name="service"/> as a <see cref="ServiceLifetime.
Scoped
"/> service
194
/// Adds the specified <typeparamref name="TService"/> as a <see cref="ServiceLifetime.
Scoped
"/> service
209
/// Adds the specified <typeparamref name="TService"/> as a <see cref="ServiceLifetime.
Scoped
"/> service
227
/// Adds the specified <typeparamref name="TService"/> as a <see cref="ServiceLifetime.
Scoped
"/> service
ServiceCollectionServiceExtensions.cs (9)
165
/// <seealso cref="ServiceLifetime.
Scoped
"/>
175
return Add(services, serviceType, implementationType, ServiceLifetime.
Scoped
);
187
/// <seealso cref="ServiceLifetime.
Scoped
"/>
197
return Add(services, serviceType, implementationFactory, ServiceLifetime.
Scoped
);
209
/// <seealso cref="ServiceLifetime.
Scoped
"/>
226
/// <seealso cref="ServiceLifetime.
Scoped
"/>
244
/// <seealso cref="ServiceLifetime.
Scoped
"/>
262
/// <seealso cref="ServiceLifetime.
Scoped
"/>
285
/// <seealso cref="ServiceLifetime.
Scoped
"/>
ServiceCollectionServiceExtensions.Keyed.cs (9)
182
/// <seealso cref="ServiceLifetime.
Scoped
"/>
193
return AddKeyed(services, serviceType, serviceKey, implementationType, ServiceLifetime.
Scoped
);
206
/// <seealso cref="ServiceLifetime.
Scoped
"/>
217
return AddKeyed(services, serviceType, serviceKey, implementationFactory, ServiceLifetime.
Scoped
);
230
/// <seealso cref="ServiceLifetime.
Scoped
"/>
250
/// <seealso cref="ServiceLifetime.
Scoped
"/>
270
/// <seealso cref="ServiceLifetime.
Scoped
"/>
291
/// <seealso cref="ServiceLifetime.
Scoped
"/>
316
/// <seealso cref="ServiceLifetime.
Scoped
"/>
ServiceDescriptor.cs (20)
532
/// and the <see cref="ServiceLifetime.
Scoped
"/> lifetime.
541
return DescribeKeyed<TService, TImplementation>(null, ServiceLifetime.
Scoped
);
547
/// and the <see cref="ServiceLifetime.
Scoped
"/> lifetime.
557
return DescribeKeyed<TService, TImplementation>(serviceKey, ServiceLifetime.
Scoped
);
563
/// and the <see cref="ServiceLifetime.
Scoped
"/> lifetime.
572
return Describe(service, implementationType, ServiceLifetime.
Scoped
);
578
/// and the <see cref="ServiceLifetime.
Scoped
"/> lifetime.
589
return DescribeKeyed(service, serviceKey, implementationType, ServiceLifetime.
Scoped
);
596
/// and the <see cref="ServiceLifetime.
Scoped
"/> lifetime.
609
return Describe(typeof(TService), implementationFactory, ServiceLifetime.
Scoped
);
616
/// and the <see cref="ServiceLifetime.
Scoped
"/> lifetime.
631
return DescribeKeyed(typeof(TService), serviceKey, implementationFactory, ServiceLifetime.
Scoped
);
637
/// and the <see cref="ServiceLifetime.
Scoped
"/> lifetime.
647
return Describe(typeof(TService), implementationFactory, ServiceLifetime.
Scoped
);
653
/// and the <see cref="ServiceLifetime.
Scoped
"/> lifetime.
664
return DescribeKeyed(typeof(TService), serviceKey, implementationFactory, ServiceLifetime.
Scoped
);
670
/// and the <see cref="ServiceLifetime.
Scoped
"/> lifetime.
680
return Describe(service, implementationFactory, ServiceLifetime.
Scoped
);
686
/// and the <see cref="ServiceLifetime.
Scoped
"/> lifetime.
697
return DescribeKeyed(service, serviceKey, implementationFactory, ServiceLifetime.
Scoped
);
Microsoft.Extensions.Http (2)
DependencyInjection\HttpClientBuilderExtensions.cs (2)
652
/// By default, the lifetime is <see cref="ServiceLifetime.
Scoped
"/>.
687
public static IHttpClientBuilder AddAsKeyed(this IHttpClientBuilder builder, ServiceLifetime lifetime = ServiceLifetime.
Scoped
)