namespace LiteCharms.Features.Extensions; public static class TaskCancellation { public static IServiceCollection AddCancellationToken(this IServiceCollection services) { services.AddScoped(); services.AddScoped(typeof(CancellationToken), provider => provider.GetRequiredService().Token); return services; } }