Поделиться через


KeyedServiceExtensions.AddTransientKeyedService Метод

Определение

Перегрузки

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

Регистрация временной службы с ключом

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

Регистрация временной службы с ключом

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

Исходный код:
KeyedService.cs

Регистрация временной службы с ключом

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddTransientKeyedService<TKey,TService,TInstance> (this Microsoft.Extensions.DependencyInjection.IServiceCollection collection, TKey key) where TService : class where TInstance : class, TService;
static member AddTransientKeyedService : Microsoft.Extensions.DependencyInjection.IServiceCollection * 'Key -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Service : null)
<Extension()>
Public Function AddTransientKeyedService(Of TKey, TService, TInstance) (collection As IServiceCollection, key As TKey) As IServiceCollection

Параметры типа

TKey
TService
TInstance

Параметры

collection
IServiceCollection
key
TKey

Возвращаемое значение

Применяется к

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

Исходный код:
KeyedService.cs

Регистрация временной службы с ключом

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddTransientKeyedService<TKey,TService> (this Microsoft.Extensions.DependencyInjection.IServiceCollection collection, TKey key, Func<IServiceProvider,TKey,TService> factory) where TService : class;
static member AddTransientKeyedService : Microsoft.Extensions.DependencyInjection.IServiceCollection * 'Key * Func<IServiceProvider, 'Key, 'Service (requires 'Service : null)> -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Service : null)
<Extension()>
Public Function AddTransientKeyedService(Of TKey, TService) (collection As IServiceCollection, key As TKey, factory As Func(Of IServiceProvider, TKey, TService)) As IServiceCollection

Параметры типа

TKey
TService

Параметры

collection
IServiceCollection
key
TKey
factory
Func<IServiceProvider,TKey,TService>

Возвращаемое значение

Применяется к