Edit

Share via


KeyedServiceExtensions Class

Definition

Extensions for working with keyed services.

public static class KeyedServiceExtensions
type KeyedServiceExtensions = class
Public Module KeyedServiceExtensions
Inheritance
KeyedServiceExtensions

Methods

AddSingletonKeyedService<TKey,TService,TInstance>(IServiceCollection, TKey)

Register a singleton keyed service

AddSingletonKeyedService<TKey,TService>(IServiceCollection, TKey, Func<IServiceProvider,TKey,TService>)

Register a singleton keyed service

AddSingletonNamedService<TService,TInstance>(IServiceCollection, String)

Register a singleton named service

AddSingletonNamedService<TService>(IServiceCollection, String, Func<IServiceProvider,String,TService>)

Register a singleton named service

AddSingletonNamedService<TService>(IServiceCollection, String, Type)
AddTransientKeyedService<TKey,TService,TInstance>(IServiceCollection, TKey)

Register a transient keyed service

AddTransientKeyedService<TKey,TService>(IServiceCollection, TKey, Func<IServiceProvider,TKey,TService>)

Register a transient keyed service

AddTransientNamedService<TService,TInstance>(IServiceCollection, String)

Register a transient named service

AddTransientNamedService<TService>(IServiceCollection, String, Func<IServiceProvider,String,TService>)

Register a transient named service

GetServiceByKey<TKey,TService>(IServiceProvider, TKey)

Acquire a service by key.

GetServiceByName<TService>(IServiceProvider, String)

Acquire a service by name.

Applies to