using Microsoft.Extensions.DependencyInjection; using MycroForge.CLI.Commands.Interfaces; using MycroForge.CLI.Features; namespace MycroForge.CLI.Extensions; public static class ServiceCollectionExtensions { public static IServiceCollection AddServices(this IServiceCollection services) { services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); return services; } public static IServiceCollection AddCommands(this IServiceCollection services) { // Register "m4g" services.AddScoped(); services.AddScoped, Commands.MycroForge.Init>(); services.AddScoped, Commands.MycroForge.Install>(); services.AddScoped, Commands.MycroForge.Uninstall>(); // Register "m4g api" services.AddScoped, Commands.MycroForge.Api>(); services.AddScoped, Commands.MycroForge.Api.Run>(); services.AddScoped, Commands.MycroForge.Api.Generate>(); services.AddScoped, Commands.MycroForge.Api.Generate.Router>(); // Register "m4g orm" services.AddScoped, Commands.MycroForge.Orm>(); services.AddScoped, Commands.MycroForge.Orm.Migrate>(); services.AddScoped, Commands.MycroForge.Orm.Rollback>(); services.AddScoped, Commands.MycroForge.Orm.Generate>(); services.AddScoped, Commands.MycroForge.Orm.Generate.Entity>(); services.AddScoped, Commands.MycroForge.Orm.Generate.Migration>(); services.AddScoped, Commands.MycroForge.Orm.Link>(); services.AddScoped, Commands.MycroForge.Orm.Link.One>(); services.AddScoped, Commands.MycroForge.Orm.Link.Many>(); // Register "m4g script" services.AddScoped, Commands.MycroForge.Script>(); services.AddScoped, Commands.MycroForge.Script.Run>(); return services; } }