Update commands registration

Now use reflection to load all commands directly into the DI container
This commit is contained in:
2021-06-05 11:02:33 +02:00
parent b040f5b0b2
commit 933d123d44
2 changed files with 34 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
using Akari.Prototype.Server.Cli.Commands;
using Akari.Prototype.Server.Options;
using Akari.Prototype.Server.Utils.Extensions;
using CliFx;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
@@ -74,9 +75,7 @@ namespace Akari.Prototype.Server
{
Startup.ConfigureStandardServices(hostContext.Configuration, services);
services.AddTransient<FingerprintCommands>();
services.AddTransient<FingerprintCommands.RemoveFingerprintCommand>();
services.AddTransient<FingerprintCommands.AddFingerprintCommand>();
services.AddCommandsFromThisAssembly();
});
public static IHostBuilder CreateWebHostBuilder(string[] args) =>