namespace Luna.Core.Tools.Extensions; public static class ServiceCollectionExtensions { extension(IServiceCollection services) { public IServiceCollection AddTools() { services.AddSingleton(); typeof(ToolsProvider).Assembly.GetTypes() .Where(t => typeof(IToolbox).IsAssignableFrom(t) && !t.IsInterface && !t.IsAbstract) .ToList() .ForEach(t => services.AddTransient(typeof(IToolbox), t)); return services; } } }