ServiceProviderServiceExtensions.GetService<T>(IServiceProvider) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Obtenir le service de type T à partir du IServiceProvider.
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static T GetService(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
Paramètres de type
- T
Type d’objet de service à obtenir.
Paramètres
- provider
- IServiceProvider
À IServiceProvider partir duquel récupérer l’objet de service.
Retours
Objet de service de type T ou null s’il n’existe aucun service de ce type.