次の方法で共有


KeyedServiceExtensions.GetServiceByKey<TKey,TService> メソッド

定義

キーでサービスを取得します。

public static TService GetServiceByKey<TKey,TService> (this IServiceProvider services, TKey key) where TService : class;
static member GetServiceByKey : IServiceProvider * 'Key -> 'Service (requires 'Service : null)
<Extension()>
Public Function GetServiceByKey(Of TKey, TService) (services As IServiceProvider, key As TKey) As TService

型パラメーター

TKey
TService

パラメーター

services
IServiceProvider
key
TKey

戻り値

TService

適用対象