switch around all iconfiguration usage to ioptions

This commit is contained in:
rootdarkarchon
2022-12-23 01:53:21 +01:00
parent b8d61b38bd
commit 7ee7fdaf48
21 changed files with 218 additions and 99 deletions

View File

@@ -1,3 +1,5 @@
using Microsoft.Extensions.Options;
namespace MareSynchronosStaticFilesServer;
public class Program
@@ -7,6 +9,14 @@ public class Program
var hostBuilder = CreateHostBuilder(args);
var host = hostBuilder.Build();
using (var scope = host.Services.CreateScope())
{
var options = host.Services.GetService<IOptions<StaticFilesServerConfiguration>>();
var logger = host.Services.GetService<ILogger<Program>>();
logger.LogInformation("Loaded MareSynchronos Static Files Server Configuration");
logger.LogInformation(options.Value.ToString());
}
host.Run();
}