33 references to IsKeyedService
Microsoft.Extensions.AI.Tests (6)
ChatCompletion\DependencyInjectionPatterns.cs (4)
127
Assert.False(sd.
IsKeyedService
);
149
Assert.True(sd.
IsKeyedService
);
173
Assert.False(sd.
IsKeyedService
);
218
Assert.True(sd.
IsKeyedService
);
SpeechToText\SpeechToTextClientDependencyInjectionPatterns.cs (2)
127
Assert.False(sd.
IsKeyedService
);
149
Assert.True(sd.
IsKeyedService
);
Microsoft.Extensions.DependencyInjection (7)
DependencyInjectionEventSource.cs (2)
252
else if (!descriptor.
IsKeyedService
&& descriptor.ImplementationFactory != null)
257
else if (descriptor.
IsKeyedService
&& descriptor.KeyedImplementationFactory != null)
ServiceLookup\CallSiteFactory.cs (2)
481
else if (!descriptor.
IsKeyedService
&& descriptor.ImplementationFactory != null)
485
else if (descriptor.
IsKeyedService
&& descriptor.KeyedImplementationFactory != null)
ServiceLookup\ServiceDescriptorExtensions.cs (3)
19
return serviceDescriptor.
IsKeyedService
26
return serviceDescriptor.
IsKeyedService
34
return 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.
163
public 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.
177
if (!
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.
194
public 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.
207
if (!
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.
224
public 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.
237
if (!
IsKeyedService
)
255
if (
IsKeyedService
)
1041
if (
IsKeyedService
)