API
AddHostedService<T>
Registers a hosted service with the host.
Formal Syntax & Structure
csharp syntaxcsharp
builder.Services.AddHostedService<Worker>();Working Example
Example Snippetcsharp
// Documentary fragment; see mapped lesson for context.builder.Services.AddHostedService<Worker>();