KeyedServiceExtensions.AddTransientNamedService 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
AddTransientNamedService<TService,TInstance>(IServiceCollection, String) |
註冊暫時性具名服務 |
AddTransientNamedService<TService>(IServiceCollection, String, Func<IServiceProvider,String,TService>) |
註冊暫時性具名服務 |
AddTransientNamedService<TService,TInstance>(IServiceCollection, String)
註冊暫時性具名服務
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddTransientNamedService<TService,TInstance> (this Microsoft.Extensions.DependencyInjection.IServiceCollection collection, string name) where TService : class where TInstance : class, TService;
static member AddTransientNamedService : Microsoft.Extensions.DependencyInjection.IServiceCollection * string -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Service : null)
<Extension()>
Public Function AddTransientNamedService(Of TService As Class, TInstance As Class) (collection As IServiceCollection, name As String) As IServiceCollection
類型參數
- TService
- TInstance
參數
- collection
- IServiceCollection
- name
- String
傳回
適用於
AddTransientNamedService<TService>(IServiceCollection, String, Func<IServiceProvider,String,TService>)
註冊暫時性具名服務
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddTransientNamedService<TService> (this Microsoft.Extensions.DependencyInjection.IServiceCollection collection, string name, Func<IServiceProvider,string,TService> factory) where TService : class;
static member AddTransientNamedService : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Func<IServiceProvider, string, 'Service (requires 'Service : null)> -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Service : null)
<Extension()>
Public Function AddTransientNamedService(Of TService As Class) (collection As IServiceCollection, name As String, factory As Func(Of IServiceProvider, String, TService)) As IServiceCollection
類型參數
- TService
參數
- collection
- IServiceCollection
- name
- String
- factory
- Func<IServiceProvider,String,TService>