using System.Collections.Concurrent; using Kruzya.TelegramBot.Core.Cache; using Kruzya.TelegramBot.Core.Options; using Microsoft.Extensions.DependencyInjection; namespace Kruzya.TelegramBot.Core.Extensions; public static class StartupExtension { public static IServiceCollection AddQueue(this IServiceCollection collection) => collection.AddSingleton>(); public static IServiceCollection AddMemoryCache(this IServiceCollection collection) => collection.AddSingleton>(); public static IServiceCollection AddOption(this IServiceCollection collection) where T : class, IOption => collection.AddScoped() .AddScoped(s => s.GetService()); }