AsyncServiceProviderInjection<TService,TInterface>.GetServiceAsync 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.
Surcharges
| GetServiceAsync() |
Retourne de manière asynchrone le service récupéré. |
| GetServiceAsync(Boolean) |
Retourne de manière asynchrone le service récupéré. |
GetServiceAsync()
Retourne de manière asynchrone le service récupéré.
public System.Threading.Tasks.Task<TInterface> GetServiceAsync();
member this.GetServiceAsync : unit -> System.Threading.Tasks.Task<'Interface (requires 'Interface : null)>
Public Function GetServiceAsync () As Task(Of TInterface)
Retours
Instance du TService service.
Exceptions
S’il n’existe aucun service de type TService disponible.
Remarques
Plusieurs appels à cette méthode retournent le même instance de TInterface.
S’applique à
GetServiceAsync(Boolean)
Retourne de manière asynchrone le service récupéré.
public System.Threading.Tasks.Task<TInterface?> GetServiceAsync(bool assumePresent);
member this.GetServiceAsync : bool -> System.Threading.Tasks.Task<'Interface (requires 'Interface : null)>
Public Function GetServiceAsync (assumePresent As Boolean) As Task(Of TInterface)
Paramètres
- assumePresent
- Boolean
Retours
Instance du TService service.
Exceptions
Quand assumePresent est et qu’aucun service de type TService n’est true disponible.
Remarques
Plusieurs appels à cette méthode retournent le même instance de TInterface.