19 references to KeyedImplementationFactory
Microsoft.Extensions.AI.Tests (6)
ChatCompletion\DependencyInjectionPatterns.cs (4)
152Assert.NotNull(sd.KeyedImplementationFactory); 153Assert.IsType<TestChatClient>(sd.KeyedImplementationFactory(null!, null!)); 221Assert.NotNull(sd.KeyedImplementationFactory); 222Assert.IsType<TestEmbeddingGenerator>(sd.KeyedImplementationFactory(null!, null!));
SpeechToText\SpeechToTextClientDependencyInjectionPatterns.cs (2)
152Assert.NotNull(sd.KeyedImplementationFactory); 153Assert.IsType<TestSpeechToTextClient>(sd.KeyedImplementationFactory(null!, null!));
Microsoft.Extensions.DependencyInjection (5)
DependencyInjectionEventSource.cs (2)
257else if (descriptor.IsKeyedService && descriptor.KeyedImplementationFactory != null) 260builder.Append(descriptor.KeyedImplementationFactory.Method);
ServiceLookup\CallSiteFactory.cs (2)
424else if (descriptor.IsKeyedService && descriptor.KeyedImplementationFactory != null) 426callSite = new FactoryCallSite(lifetime, descriptor.ServiceType, serviceIdentifier.ServiceKey!, descriptor.KeyedImplementationFactory);
ServiceLookup\ServiceDescriptorExtensions.cs (1)
27? serviceDescriptor.KeyedImplementationFactory
Microsoft.Extensions.DependencyInjection.Abstractions (8)
ServiceDescriptor.cs (8)
222/// If <see cref="IsKeyedService"/> is <see langword="true"/>, <see cref="KeyedImplementationFactory"/> should be called instead. 264if (KeyedImplementationFactory != null) 267DiagnosticMethodInfo? dmi = DiagnosticMethodInfo.Create(KeyedImplementationFactory); 276return lifetime + $"{nameof(KeyedImplementationFactory)}: {declaringTypeName}.{methodName}"; 338else if (KeyedImplementationFactory != null) 340Type[]? typeArguments = KeyedImplementationFactory.GetType().GenericTypeArguments; 1048else if (KeyedImplementationFactory != null) 1050debugText += $@", KeyedImplementationFactory = {KeyedImplementationFactory.Method}";