addKeyedTransient<TService> method
ServiceCollection
addKeyedTransient<TService>(
- Object? serviceKey,
- KeyedImplementationFactory implementationFactory
Adds a keyed transient service of the type specified in TService
with a factory specified in implementationFactory to the specified
ServiceCollection.
Implementation
ServiceCollection addKeyedTransient<TService>(
Object? serviceKey,
KeyedImplementationFactory implementationFactory,
) {
final descriptor = ServiceDescriptor.keyedTransient<TService>(
serviceKey,
(services) => implementationFactory,
);
add(descriptor);
return this;
}