Table of Contents

Class MinimalConsoleHostedService

Namespace
Codebelt.Bootstrapper.Console
Assembly
Codebelt.Bootstrapper.Console.dll

Provides a console application that is managed by its host.

public class MinimalConsoleHostedService : IHostedService
Inheritance
MinimalConsoleHostedService
Implements

Constructors

MinimalConsoleHostedService(IProgramFactory, IHostApplicationLifetime, IServiceProvider, IHostLifetimeEvents)

Initializes a new instance of the MinimalConsoleHostedService class.

public MinimalConsoleHostedService(IProgramFactory factory, IHostApplicationLifetime applicationLifetime, IServiceProvider provider, IHostLifetimeEvents events)

Parameters

factory IProgramFactory

The dependency injected IProgramFactory.

applicationLifetime IHostApplicationLifetime

The dependency injected IHostApplicationLifetime.

provider IServiceProvider

The dependency injected IServiceProvider.

events IHostLifetimeEvents

The dependency injected IHostLifetimeEvents.

Methods

StartAsync(CancellationToken)

Triggered when the application host is ready to start the service.

public Task StartAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Indicates that the start process has been aborted.

Returns

Task

A Task that represents the asynchronous operation.

StopAsync(CancellationToken)

Triggered when the application host is performing a graceful shutdown.

public Task StopAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Indicates that the shutdown process should no longer be graceful.

Returns

Task

A Task that represents the asynchronous operation.

See Also