ServiceProviderServiceExtensions.GetService<T>(IServiceProvider) Metoda

Definice

Načte službu typu T z IServiceProvider .Get service of type T from the IServiceProvider.

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static T GetService(IServiceProvider ^ provider);
public static T GetService<T> (this IServiceProvider provider);
public static T? GetService<T> (this IServiceProvider provider);
static member GetService : IServiceProvider -> 'T
<Extension()>
Public Function GetService(Of T) (provider As IServiceProvider) As T

Parametry typu

T

Typ objektu služby, který se má získatThe type of service object to get.

Parametry

provider
IServiceProvider

IServiceProviderPro načtení objektu služby z.The IServiceProvider to retrieve the service object from.

Návraty

T

Objekt služby typu T nebo null, pokud taková služba neexistuje.A service object of type T or null if there is no such service.

Platí pro