Udostępnij przez


AsyncServiceProviderInjection<TService,TInterface>.GetServiceAsync Metoda

Definicja

Przeciążenia

GetServiceAsync()

Asynchronicznie zwraca pobraną usługę.

GetServiceAsync(Boolean)

Asynchronicznie zwraca pobraną usługę.

GetServiceAsync()

Asynchronicznie zwraca pobraną usługę.

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)

Zwraca

Task<TInterface>

Wystąpienie TService usługi.

Wyjątki

Jeśli nie ma żadnej usługi typu TService dostępnej.

Uwagi

Wiele wywołań do tej metody zwróci to samo wystąpienie klasy TInterface.

Dotyczy

GetServiceAsync(Boolean)

Asynchronicznie zwraca pobraną usługę.

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)

Parametry

assumePresent
Boolean

Zwraca

Task<TInterface>

Wystąpienie TService usługi.

Wyjątki

Kiedy assumePresent jest true i nie ma żadnej usługi typu TService dostępne.

Uwagi

Wiele wywołań do tej metody zwróci to samo wystąpienie klasy TInterface.

Dotyczy