Class RouteHostedService
integration for the route context.
Starts and stops routes with the application lifecycle.
Register via .
public sealed class RouteHostedService : IHostedService, IAsyncDisposable
Inheritance
Implements
Methods
DisposeAsync()
Performs application-defined tasks associated with freeing, releasing, or
public ValueTask DisposeAsync()
StartAsync(CancellationToken)
Triggered when the application host is ready to start the service.
public Task StartAsync(CancellationToken cancellationToken)
StopAsync(CancellationToken)
Triggered when the application host is performing a graceful shutdown.
public Task StopAsync(CancellationToken cancellationToken)
Constructors
RouteHostedService(RouteContext, IEnumerable<IRouteContextConfigurator>, ILogger<RouteHostedService>)
Creates a new hosted service wrapping the route context.