Partilhar via


FakeHostingExtensions.StartAndStopAsync Método

Definição

Inicia e interrompe imediatamente o serviço.

public static System.Threading.Tasks.Task StartAndStopAsync (this Microsoft.Extensions.Hosting.IHostedService service, System.Threading.CancellationToken cancellationToken = default);
static member StartAndStopAsync : Microsoft.Extensions.Hosting.IHostedService * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function StartAndStopAsync (service As IHostedService, Optional cancellationToken As CancellationToken = Nothing) As Task

Parâmetros

service
IHostedService

O serviço testado.

cancellationToken
CancellationToken

Token de cancelamento. Consulte CancellationToken.

Retornos

Um Task representando a operação assíncrona.

Aplica-se a