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.
Obtient 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);
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 de l’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.
S’applique à
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de 2024, nous allons supprimer progressivement GitHub Issues comme mécanisme de commentaires pour le contenu et le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultezEnvoyer et afficher des commentaires pour