KeyedServiceExtensions.AddSingletonKeyedService Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Sobrecargas
AddSingletonKeyedService<TKey,TService,TInstance>(IServiceCollection, TKey) |
Registro de un servicio con clave singleton |
AddSingletonKeyedService<TKey,TService>(IServiceCollection, TKey, Func<IServiceProvider,TKey,TService>) |
Registro de un servicio con clave singleton |
AddSingletonKeyedService<TKey,TService,TInstance>(IServiceCollection, TKey)
- Source:
- KeyedService.cs
Registro de un servicio con clave singleton
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
Parámetros de tipo
- TKey
- TService
- TInstance
Parámetros
- collection
- IServiceCollection
- key
- TKey
Devoluciones
Se aplica a
AddSingletonKeyedService<TKey,TService>(IServiceCollection, TKey, Func<IServiceProvider,TKey,TService>)
- Source:
- KeyedService.cs
Registro de un servicio con clave singleton
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
Parámetros de tipo
- TKey
- TService
Parámetros
- collection
- IServiceCollection
- key
- TKey
- factory
- Func<IServiceProvider,TKey,TService>