KeyedServiceExtensions.GetServiceByName<TService> 方法

定义

按名称获取服务。

public static TService GetServiceByName<TService> (this IServiceProvider services, string name) where TService : class;
static member GetServiceByName : IServiceProvider * string -> 'Service (requires 'Service : null)
<Extension()>
Public Function GetServiceByName(Of TService As Class) (services As IServiceProvider, name As String) As TService

类型参数

TService

参数

services
IServiceProvider
name
String

返回

TService

适用于