ServiceCollectionServiceExtensions extension

Extension methods for adding services to a ServiceCollection.

on

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 in TService with a factory specified in implementationFactory to 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 in TService with a factory specified in implementationFactory to 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 in TService with an instance specified in implementationInstance to 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 in TService with a factory specified in implementationFactory to 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 in TService with a factory specified in implementationFactory to the specified ServiceCollection.