Class BackgroundTaskExtensions
- Namespace
- Microsoft.Extensions.DependencyInjection
- Assembly
- Stratara.Infrastructure.dll
Service-collection extensions that wire the in-process background-task queue and its drain worker.
public static class BackgroundTaskExtensions
- Inheritance
-
BackgroundTaskExtensions
- Inherited Members
Methods
AddBackgroundTasks(IServiceCollection)
Registers Stratara.Infrastructure.BackgroundTasks.QueuedHostedService and a singleton IBackgroundTaskQueue with a default capacity of 100 pending items.
public static IServiceCollection AddBackgroundTasks(this IServiceCollection services)
Parameters
servicesIServiceCollectionThe service collection.
Returns
- IServiceCollection
The same service collection for chaining.
Examples
services.AddBackgroundTasks();