Compartir a través de


AsyncServiceProviderInjection<TService,TInterface>.GetServiceAsync Método

Definición

Sobrecargas

GetServiceAsync()

Devuelve de forma asincrónica el servicio recuperado.

GetServiceAsync(Boolean)

Devuelve de forma asincrónica el servicio recuperado.

GetServiceAsync()

Devuelve de forma asincrónica el servicio recuperado.

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)

Devoluciones

Task<TInterface>

Instancia del TService servicio.

Excepciones

Si no hay ningún servicio de tipo TService disponible.

Comentarios

Varias llamadas a este método devolverán la misma instancia de TInterface.

Se aplica a

GetServiceAsync(Boolean)

Devuelve de forma asincrónica el servicio recuperado.

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)

Parámetros

assumePresent
Boolean

Devoluciones

Task<TInterface>

Instancia del TService servicio.

Excepciones

Cuando assumePresent es true y no hay ningún servicio de tipo TService disponible.

Comentarios

Varias llamadas a este método devolverán la misma instancia de TInterface.

Se aplica a