feat(Program.cs): Hosting-Unterstützung zu CommandManagerRunner hinzufügen

- Einführung von `Microsoft.Extensions.Hosting` in `DependencyInjection.cs`.
- Überladung für `RunCommandManagerRunner` hinzugefügt, um `IHost` zu akzeptieren.
- Aktualisiert `Program.cs`, um die neue Methode `RunCommandManagerRunner` zu verwenden.
This commit is contained in:
Developer 02 2025-04-14 13:18:50 +02:00
parent e171b50868
commit 54c17f106e
2 changed files with 4 additions and 1 deletions

View File

@ -8,6 +8,7 @@ using Microsoft.Extensions.Configuration;
using Microsoft.EntityFrameworkCore;
using EnvelopeGenerator.Application.Contracts.Services;
using EnvelopeGenerator.Application.Services;
using Microsoft.Extensions.Hosting;
namespace EnvelopeGenerator.Terminal;
@ -48,4 +49,6 @@ public static class DependencyInjection
var runner = provider.GetRequiredService<AppRunner<CommandManager>>();
return runner.RunAsync(args);
}
public static Task<int> RunCommandManagerRunner(this IHost host, string[] args) => host.Services.RunCommandManagerRunner(args);
}

View File

@ -14,6 +14,6 @@ public class Program
var app = builder.Build();
return await app.Services.RunCommandManagerRunner(args);
return await app.RunCommandManagerRunner(args);
}
}