ServiceProviderKeyedServiceExtensions.GetRequiredKeyedService メソッド

定義

オーバーロード

GetRequiredKeyedService(IServiceProvider, Type, Object)

から 型 serviceType のサービスを取得します IServiceProvider

GetRequiredKeyedService<T>(IServiceProvider, Object)

から 型 T のサービスを取得します IServiceProvider

GetRequiredKeyedService(IServiceProvider, Type, Object)

ソース:
ServiceProviderKeyedServiceExtensions.cs
ソース:
ServiceProviderKeyedServiceExtensions.cs
ソース:
ServiceProviderKeyedServiceExtensions.cs
ソース:
ServiceProviderKeyedServiceExtensions.cs

から 型 serviceType のサービスを取得します IServiceProvider

public:
[System::Runtime::CompilerServices::Extension]
 static System::Object ^ GetRequiredKeyedService(IServiceProvider ^ provider, Type ^ serviceType, System::Object ^ serviceKey);
public static object GetRequiredKeyedService (this IServiceProvider provider, Type serviceType, object? serviceKey);
static member GetRequiredKeyedService : IServiceProvider * Type * obj -> obj
<Extension()>
Public Function GetRequiredKeyedService (provider As IServiceProvider, serviceType As Type, serviceKey As Object) As Object

パラメーター

provider
IServiceProvider

サービス オブジェクトの取得元の IServiceProvider

serviceType
Type

取得対象となるサービスの型を指定するオブジェクト。

serviceKey
Object

取得するサービス オブジェクトのキーを指定する オブジェクト。

戻り値

serviceType 型のサービス オブジェクト。

例外

serviceType 型のサービスはありません。

適用対象

GetRequiredKeyedService<T>(IServiceProvider, Object)

ソース:
ServiceProviderKeyedServiceExtensions.cs
ソース:
ServiceProviderKeyedServiceExtensions.cs
ソース:
ServiceProviderKeyedServiceExtensions.cs
ソース:
ServiceProviderKeyedServiceExtensions.cs

から 型 T のサービスを取得します IServiceProvider

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static T GetRequiredKeyedService(IServiceProvider ^ provider, System::Object ^ serviceKey);
public static T GetRequiredKeyedService<T> (this IServiceProvider provider, object? serviceKey);
static member GetRequiredKeyedService : IServiceProvider * obj -> 'T
<Extension()>
Public Function GetRequiredKeyedService(Of T) (provider As IServiceProvider, serviceKey As Object) As T

型パラメーター

T

取得するサービス オブジェクトの型。

パラメーター

provider
IServiceProvider

サービス オブジェクトの取得元の IServiceProvider

serviceKey
Object

取得するサービス オブジェクトのキーを指定する オブジェクト。

戻り値

T

T 型のサービス オブジェクト。

例外

T 型のサービスはありません。

適用対象