KeyedServiceExtensions.AddSingletonKeyedService Methode
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Überlädt
AddSingletonKeyedService<TKey,TService,TInstance>(IServiceCollection, TKey) |
Registrieren eines Singleton-Schlüsseldiensts |
AddSingletonKeyedService<TKey,TService>(IServiceCollection, TKey, Func<IServiceProvider,TKey,TService>) |
Registrieren eines Singleton-Schlüsseldiensts |
AddSingletonKeyedService<TKey,TService,TInstance>(IServiceCollection, TKey)
- Quelle:
- KeyedService.cs
Registrieren eines Singleton-Schlüsseldiensts
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddSingletonKeyedService<TKey,TService,TInstance> (this Microsoft.Extensions.DependencyInjection.IServiceCollection collection, TKey key) where TService : class where TInstance : class, TService;
static member AddSingletonKeyedService : Microsoft.Extensions.DependencyInjection.IServiceCollection * 'Key -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Service : null)
<Extension()>
Public Function AddSingletonKeyedService(Of TKey, TService, TInstance) (collection As IServiceCollection, key As TKey) As IServiceCollection
Typparameter
- TKey
- TService
- TInstance
Parameter
- collection
- IServiceCollection
- key
- TKey
Gibt zurück
Gilt für:
AddSingletonKeyedService<TKey,TService>(IServiceCollection, TKey, Func<IServiceProvider,TKey,TService>)
- Quelle:
- KeyedService.cs
Registrieren eines Singleton-Schlüsseldiensts
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddSingletonKeyedService<TKey,TService> (this Microsoft.Extensions.DependencyInjection.IServiceCollection collection, TKey key, Func<IServiceProvider,TKey,TService> factory) where TService : class;
static member AddSingletonKeyedService : Microsoft.Extensions.DependencyInjection.IServiceCollection * 'Key * Func<IServiceProvider, 'Key, 'Service (requires 'Service : null)> -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Service : null)
<Extension()>
Public Function AddSingletonKeyedService(Of TKey, TService) (collection As IServiceCollection, key As TKey, factory As Func(Of IServiceProvider, TKey, TService)) As IServiceCollection
Typparameter
- TKey
- TService
Parameter
- collection
- IServiceCollection
- key
- TKey
- factory
- Func<IServiceProvider,TKey,TService>