From 25f1563ef532035acc1fd8cdf656671e56a68eaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matija=20Ko=C5=BEelj?= Date: Wed, 4 Jan 2023 15:13:14 +0100 Subject: [PATCH] Convert dictionary initialization to standard IConfig initialization --- src/Connected.Runtime/IStartup.cs | 5 +++-- src/Connected.Runtime/Startup.cs | 13 +++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/Connected.Runtime/IStartup.cs b/src/Connected.Runtime/IStartup.cs index 83edb8a..3819bf0 100644 --- a/src/Connected.Runtime/IStartup.cs +++ b/src/Connected.Runtime/IStartup.cs @@ -1,4 +1,5 @@ using Microsoft.AspNetCore.Builder; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; namespace Connected; @@ -7,6 +8,6 @@ public interface IStartup { void ConfigureServices(IServiceCollection services); void Configure(WebApplication app); - Task Initialize(Dictionary args); - Task Start(Dictionary args); + Task Initialize(IConfiguration config); + Task Start(IConfiguration config); } diff --git a/src/Connected.Runtime/Startup.cs b/src/Connected.Runtime/Startup.cs index a50b7e6..a625ae7 100644 --- a/src/Connected.Runtime/Startup.cs +++ b/src/Connected.Runtime/Startup.cs @@ -1,4 +1,5 @@ using Microsoft.AspNetCore.Builder; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; namespace Connected; @@ -27,22 +28,22 @@ public abstract class Startup : IStartup } - public async Task Initialize(Dictionary args) + public async Task Initialize(IConfiguration config) { - await OnInitialize(args); + await OnInitialize(config); } - protected virtual async Task OnInitialize(Dictionary args) + protected virtual async Task OnInitialize(IConfiguration config) { await Task.CompletedTask; } - public async Task Start(Dictionary args) + public async Task Start(IConfiguration config) { - await OnStart(args); + await OnStart(config); } - protected virtual async Task OnStart(Dictionary args) + protected virtual async Task OnStart(IConfiguration config) { await Task.CompletedTask; }