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