ServiceCollectionServiceExtensions extension
Extension methods for adding services to a ServiceCollection.
Methods
-
addKeyedScoped<
TService> (Object? serviceKey, KeyedImplementationFactory implementationFactory) → ServiceCollection -
Available on ServiceCollection, provided by the ServiceCollectionServiceExtensions extension
Adds a keyed scoped service of the type specified inTServicewith a factory specified inimplementationFactoryto the specified ServiceCollection. -
addKeyedSingleton<
TService> (Object? serviceKey, KeyedImplementationFactory implementationFactory) → ServiceCollection -
Available on ServiceCollection, provided by the ServiceCollectionServiceExtensions extension
Adds a keyed singleton service of the type specified inTServicewith a factory specified inimplementationFactoryto the specified ServiceCollection. -
addKeyedSingletonInstance<
TService> (Object? serviceKey, Object implementationInstance) → ServiceCollection -
Available on ServiceCollection, provided by the ServiceCollectionServiceExtensions extension
Adds a keyed singleton service of the type specified inTServicewith an instance specified inimplementationInstanceto the specified ServiceCollection. -
addKeyedTransient<
TService> (Object? serviceKey, KeyedImplementationFactory implementationFactory) → ServiceCollection -
Available on ServiceCollection, provided by the ServiceCollectionServiceExtensions extension
Adds a keyed transient service of the type specified inTServicewith a factory specified inimplementationFactoryto the specified ServiceCollection. -
addScoped<
TService> (ImplementationFactory implementationFactory) → ServiceCollection -
Available on ServiceCollection, provided by the ServiceCollectionServiceExtensions extension
-
addSingleton<
TService> (ImplementationFactory implementationFactory) → ServiceCollection -
Available on ServiceCollection, provided by the ServiceCollectionServiceExtensions extension
-
addSingletonInstance<
TService> (Object implementationInstance) → ServiceCollection -
Available on ServiceCollection, provided by the ServiceCollectionServiceExtensions extension
-
addTransient<
TService> (ImplementationFactory implementationFactory) → ServiceCollection -
Available on ServiceCollection, provided by the ServiceCollectionServiceExtensions extension
Adds a transient service of the type specified inTServicewith a factory specified inimplementationFactoryto the specified ServiceCollection.