33 references to IsKeyedService
Microsoft.Extensions.AI.Tests (6)
ChatCompletion\DependencyInjectionPatterns.cs (4)
127Assert.False(sd.IsKeyedService); 149Assert.True(sd.IsKeyedService); 173Assert.False(sd.IsKeyedService); 218Assert.True(sd.IsKeyedService);
SpeechToText\SpeechToTextClientDependencyInjectionPatterns.cs (2)
127Assert.False(sd.IsKeyedService); 149Assert.True(sd.IsKeyedService);
Microsoft.Extensions.DependencyInjection (7)
DependencyInjectionEventSource.cs (2)
252else if (!descriptor.IsKeyedService && descriptor.ImplementationFactory != null) 257else if (descriptor.IsKeyedService && descriptor.KeyedImplementationFactory != null)
ServiceLookup\CallSiteFactory.cs (2)
481else if (!descriptor.IsKeyedService && descriptor.ImplementationFactory != null) 485else if (descriptor.IsKeyedService && descriptor.KeyedImplementationFactory != null)
ServiceLookup\ServiceDescriptorExtensions.cs (3)
19return serviceDescriptor.IsKeyedService 26return serviceDescriptor.IsKeyedService 34return serviceDescriptor.IsKeyedService
Microsoft.Extensions.DependencyInjection.Abstractions (20)
ServiceDescriptor.cs (20)
157/// or returns <see langword="null"/> if <see cref="IsKeyedService"/> is <see langword="true"/>. 160/// If <see cref="IsKeyedService"/> is <see langword="true"/>, <see cref="KeyedImplementationType"/> should be called instead. 163public Type? ImplementationType => IsKeyedService ? null : _implementationType; 167/// or throws <see cref="InvalidOperationException"/> if <see cref="IsKeyedService"/> is <see langword="false"/>. 170/// If <see cref="IsKeyedService"/> is <see langword="false"/>, <see cref="ImplementationType"/> should be called instead. 177if (!IsKeyedService) 189/// or returns <see langword="null"/> if <see cref="IsKeyedService"/> is <see langword="true"/>. 192/// If <see cref="IsKeyedService"/> is <see langword="true"/>, <see cref="KeyedImplementationInstance"/> should be called instead. 194public object? ImplementationInstance => IsKeyedService ? null : _implementationInstance; 198/// or throws <see cref="InvalidOperationException"/> if <see cref="IsKeyedService"/> is <see langword="false"/>. 201/// If <see cref="IsKeyedService"/> is <see langword="false"/>, <see cref="ImplementationInstance"/> should be called instead. 207if (!IsKeyedService) 219/// or returns <see langword="null"/> if <see cref="IsKeyedService"/> is <see langword="true"/>. 222/// If <see cref="IsKeyedService"/> is <see langword="true"/>, <see cref="KeyedImplementationFactory"/> should be called instead. 224public Func<IServiceProvider, object>? ImplementationFactory => IsKeyedService ? null : (Func<IServiceProvider, object>?) _implementationFactory; 228/// or throws <see cref="InvalidOperationException"/> if <see cref="IsKeyedService"/> is <see langword="false"/>. 231/// If <see cref="IsKeyedService"/> is <see langword="false"/>, <see cref="ImplementationFactory"/> should be called instead. 237if (!IsKeyedService) 255if (IsKeyedService) 1041if (IsKeyedService)