Język

ServiceProviderKeyedServiceExtensions.GetKeyedService Metoda

Definicja

Przeciążenia

GetKeyedService(IServiceProvider, Type, Object)

Źródło:
ServiceProviderKeyedServiceExtensions.cs
Źródło:
ServiceProviderKeyedServiceExtensions.cs
Źródło:
ServiceProviderKeyedServiceExtensions.cs

Pobierz usługę typu serviceType z .IServiceProvider

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

Parametry

provider
IServiceProvider

Element IServiceProvider do pobrania obiektu usługi z programu .

serviceType
Type

Obiekt określający typ obiektu usługi do pobrania.

serviceKey
Object

Obiekt określający klucz obiektu usługi do pobrania.

Zwraca

Obiekt usługi typu serviceType lub null, jeśli nie ma takiej usługi.

Dotyczy

GetKeyedService<T>(IServiceProvider, Object)

Źródło:
ServiceProviderKeyedServiceExtensions.cs
Źródło:
ServiceProviderKeyedServiceExtensions.cs
Źródło:
ServiceProviderKeyedServiceExtensions.cs
Źródło:
ServiceProviderKeyedServiceExtensions.cs
Źródło:
ServiceProviderKeyedServiceExtensions.cs

Pobierz usługę typu T z .IServiceProvider

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

Parametry typu

T

Typ obiektu usługi do pobrania.

Parametry

provider
IServiceProvider

Element IServiceProvider do pobrania obiektu usługi z programu .

serviceKey
Object

Obiekt określający klucz obiektu usługi do pobrania.

Zwraca

T

Obiekt usługi typu T lub null, jeśli nie ma takiej usługi.

Dotyczy