88 references to Transient
Aspire.Components.Common.TestUtilities (1)
ConformanceTests.cs (1)
239case ServiceLifetime.Transient:
Microsoft.AspNetCore.Mvc.Core.Test (3)
DependencyInjection\MvcBuilderExtensionsTest.cs (3)
100Assert.Equal(ServiceLifetime.Transient, services[0].Lifetime); 104Assert.Equal(ServiceLifetime.Transient, services[1].Lifetime); 108Assert.Equal(ServiceLifetime.Transient, services[2].Lifetime);
Microsoft.AspNetCore.Mvc.Localization.Test (9)
MvcLocalizationMvcBuilderExtensionsTest.cs (4)
55Assert.Equal(ServiceLifetime.Transient, service.Lifetime); 62Assert.Equal(ServiceLifetime.Transient, service.Lifetime); 77Assert.Equal(ServiceLifetime.Transient, service.Lifetime); 82Assert.Equal(ServiceLifetime.Transient, service.Lifetime);
MvcLocalizationMvcCoreBuilderExtensionsTest.cs (5)
55Assert.Equal(ServiceLifetime.Transient, service.Lifetime); 62Assert.Equal(ServiceLifetime.Transient, service.Lifetime); 67Assert.Equal(ServiceLifetime.Transient, service.Lifetime); 77Assert.Equal(ServiceLifetime.Transient, service.Lifetime); 82Assert.Equal(ServiceLifetime.Transient, service.Lifetime);
Microsoft.AspNetCore.Mvc.Razor.Test (6)
DependencyInjection\MvcRazorMvcBuilderExtensionsTest.cs (3)
56Assert.Equal(ServiceLifetime.Transient, tagHelperOne.Lifetime); 60Assert.Equal(ServiceLifetime.Transient, tagHelperTwo.Lifetime); 64Assert.Equal(ServiceLifetime.Transient, activator.Lifetime);
DependencyInjection\MvcRazorMvcCoreBuilderExtensionsTest.cs (3)
96Assert.Equal(ServiceLifetime.Transient, tagHelperOne.Lifetime); 100Assert.Equal(ServiceLifetime.Transient, tagHelperTwo.Lifetime); 104Assert.Equal(ServiceLifetime.Transient, activator.Lifetime);
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (2)
DependencyInjection\MvcViewFeaturesMvcBuilderExtensionsTest.cs (2)
147Assert.Equal(ServiceLifetime.Transient, collection[0].Lifetime); 151Assert.Equal(ServiceLifetime.Transient, collection[1].Lifetime);
Microsoft.Extensions.AI.Tests (12)
ChatCompletion\DependencyInjectionPatterns.cs (8)
116[InlineData(ServiceLifetime.Transient)] 138[InlineData(ServiceLifetime.Transient)] 161[InlineData(ServiceLifetime.Transient)] 184[InlineData(ServiceLifetime.Transient)] 199Assert.Equal(lifetime != ServiceLifetime.Transient, ReferenceEquals(g, ng)); 206[InlineData(ServiceLifetime.Transient)] 230[InlineData(ServiceLifetime.Transient)] 245Assert.Equal(lifetime != ServiceLifetime.Transient, ReferenceEquals(g, ng));
Image\ImageGeneratorDependencyInjectionPatterns.cs (2)
116[InlineData(ServiceLifetime.Transient)] 138[InlineData(ServiceLifetime.Transient)]
SpeechToText\SpeechToTextClientDependencyInjectionPatterns.cs (2)
116[InlineData(ServiceLifetime.Transient)] 138[InlineData(ServiceLifetime.Transient)]
Microsoft.Extensions.DependencyInjection (2)
DependencyInjectionEventSource.cs (1)
225case ServiceLifetime.Transient:
ServiceLookup\ResultCache.cs (1)
33case ServiceLifetime.Transient:
Microsoft.Extensions.DependencyInjection.Abstractions (50)
Extensions\ServiceCollectionDescriptorExtensions.cs (6)
100/// Adds the specified <paramref name="service"/> as a <see cref="ServiceLifetime.Transient"/> service 118/// Adds the specified <paramref name="service"/> as a <see cref="ServiceLifetime.Transient"/> service 140/// Adds the specified <paramref name="service"/> as a <see cref="ServiceLifetime.Transient"/> service 162/// Adds the specified <typeparamref name="TService"/> as a <see cref="ServiceLifetime.Transient"/> service 177/// Adds the specified <typeparamref name="TService"/> as a <see cref="ServiceLifetime.Transient"/> service 195/// Adds the specified <typeparamref name="TService"/> as a <see cref="ServiceLifetime.Transient"/> service
Extensions\ServiceCollectionDescriptorExtensions.Keyed.cs (6)
13/// Adds the specified <paramref name="service"/> as a <see cref="ServiceLifetime.Transient"/> service 33/// Adds the specified <paramref name="service"/> as a <see cref="ServiceLifetime.Transient"/> service 57/// Adds the specified <paramref name="service"/> as a <see cref="ServiceLifetime.Transient"/> service 81/// Adds the specified <typeparamref name="TService"/> as a <see cref="ServiceLifetime.Transient"/> service 97/// Adds the specified <typeparamref name="TService"/> as a <see cref="ServiceLifetime.Transient"/> service 116/// Adds the specified <typeparamref name="TService"/> as a <see cref="ServiceLifetime.Transient"/> service
ServiceCollectionServiceExtensions.cs (9)
28/// <seealso cref="ServiceLifetime.Transient"/> 38return Add(services, serviceType, implementationType, ServiceLifetime.Transient); 55/// <seealso cref="ServiceLifetime.Transient"/> 65return Add(services, serviceType, implementationFactory, ServiceLifetime.Transient); 82/// <seealso cref="ServiceLifetime.Transient"/> 104/// <seealso cref="ServiceLifetime.Transient"/> 127/// <seealso cref="ServiceLifetime.Transient"/> 150/// <seealso cref="ServiceLifetime.Transient"/> 178/// <seealso cref="ServiceLifetime.Transient"/>
ServiceCollectionServiceExtensions.Keyed.cs (9)
29/// <seealso cref="ServiceLifetime.Transient"/> 40return AddKeyed(services, serviceType, serviceKey, implementationType, ServiceLifetime.Transient); 58/// <seealso cref="ServiceLifetime.Transient"/> 69return AddKeyed(services, serviceType, serviceKey, implementationFactory, ServiceLifetime.Transient); 87/// <seealso cref="ServiceLifetime.Transient"/> 112/// <seealso cref="ServiceLifetime.Transient"/> 137/// <seealso cref="ServiceLifetime.Transient"/> 163/// <seealso cref="ServiceLifetime.Transient"/> 193/// <seealso cref="ServiceLifetime.Transient"/>
ServiceDescriptor.cs (20)
356/// and the <see cref="ServiceLifetime.Transient"/> lifetime. 365return DescribeKeyed<TService, TImplementation>(null, ServiceLifetime.Transient); 371/// and the <see cref="ServiceLifetime.Transient"/> lifetime. 381return DescribeKeyed<TService, TImplementation>(serviceKey, ServiceLifetime.Transient); 387/// and the <see cref="ServiceLifetime.Transient"/> lifetime. 399return Describe(service, implementationType, ServiceLifetime.Transient); 405/// and the <see cref="ServiceLifetime.Transient"/> lifetime. 419return DescribeKeyed(service, serviceKey, implementationType, ServiceLifetime.Transient); 426/// and the <see cref="ServiceLifetime.Transient"/> lifetime. 439return Describe(typeof(TService), implementationFactory, ServiceLifetime.Transient); 446/// and the <see cref="ServiceLifetime.Transient"/> lifetime. 461return DescribeKeyed(typeof(TService), serviceKey, implementationFactory, ServiceLifetime.Transient); 467/// and the <see cref="ServiceLifetime.Transient"/> lifetime. 477return Describe(typeof(TService), implementationFactory, ServiceLifetime.Transient); 483/// and the <see cref="ServiceLifetime.Transient"/> lifetime. 494return DescribeKeyed(typeof(TService), serviceKey, implementationFactory, ServiceLifetime.Transient); 500/// and the <see cref="ServiceLifetime.Transient"/> lifetime. 510return Describe(service, implementationFactory, ServiceLifetime.Transient); 516/// and the <see cref="ServiceLifetime.Transient"/> lifetime. 527return DescribeKeyed(service, serviceKey, implementationFactory, ServiceLifetime.Transient);
Microsoft.Extensions.Http (3)
DependencyInjection\HttpClientBuilderExtensions.cs (3)
664/// WARNING: Registering the client as a keyed <see cref="ServiceLifetime.Transient"/> service will lead to the <see cref="HttpClient"/> and <see cref="HttpMessageHandler"/> 669/// WARNING: In case of (1) a keyed <see cref="ServiceLifetime.Singleton"/> <see cref="HttpClient"/> registration, or (2) a keyed <see cref="ServiceLifetime.Transient"/> 672/// which can result in the loss of DNS changes. (This is a similar issue to the one with Typed Clients, that are registered as <see cref="ServiceLifetime.Transient"/> services.)