using Knot.Modules.TelegramImport.Application.Abstractions; using Knot.Modules.TelegramImport.Infrastructure.Background; using Knot.Modules.TelegramImport.Infrastructure.Parser; using Microsoft.Extensions.DependencyInjection; namespace Knot.Modules.TelegramImport; public static class DependencyInjection { public static IServiceCollection AddTelegramImportModule(this IServiceCollection services) { services.AddSingleton(); services.AddSingleton(); // Register worker as itself and as a hosted service services.AddSingleton(); services.AddHostedService(sp => sp.GetRequiredService()); return services; } }