IHostedService 介面

定義

針對由主機所管理的物件定義方法。Defines methods for objects that are managed by the host.

public interface class IHostedService
public interface IHostedService
type IHostedService = interface
Public Interface IHostedService
衍生

方法

StartAsync(CancellationToken)

當應用程式主機準備好啟動服務時觸發。Triggered when the application host is ready to start the service.

StopAsync(CancellationToken)

當應用程式主機執行順利關機時觸發。Triggered when the application host is performing a graceful shutdown.

適用於