Lire en anglais

Partager via


IHostedService Interface

Définition

Définit des méthodes pour des objets qui sont gérés par l’hôte.

C#
public interface IHostedService
Dérivé

Méthodes

StartAsync(CancellationToken)

Déclenché quand l’hôte d’application est prêt à démarrer le service.

StopAsync(CancellationToken)

Déclenché quand l’hôte d’application effectue un arrêt normal.

Méthodes d’extension

StartAndStopAsync(IHostedService, CancellationToken)

Démarre et arrête immédiatement le service.

S’applique à