KeyedServiceExtensions.AddTransientNamedService 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
AddTransientNamedService<TService,TInstance>(IServiceCollection, String) |
注册暂时性命名服务 |
AddTransientNamedService<TService>(IServiceCollection, String, Func<IServiceProvider,String,TService>) |
注册暂时性命名服务 |
AddTransientNamedService<TService,TInstance>(IServiceCollection, String)
- Source:
- KeyedService.cs
注册暂时性命名服务
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>)
- Source:
- KeyedService.cs
注册暂时性命名服务
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>