Convert dictionary initialization to standard IConfig initialization

features/nuget_autobuild
Matija Koželj 2 years ago
parent 91c7035162
commit 1a34c7b4c4

@ -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<string, string> args);
Task Start(Dictionary<string, string> args);
Task Initialize(IConfiguration config);
Task Start(IConfiguration config);
}

@ -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<string, string> args)
public async Task Initialize(IConfiguration config)
{
await OnInitialize(args);
await OnInitialize(config);
}
protected virtual async Task OnInitialize(Dictionary<string, string> args)
protected virtual async Task OnInitialize(IConfiguration config)
{
await Task.CompletedTask;
}
public async Task Start(Dictionary<string, string> args)
public async Task Start(IConfiguration config)
{
await OnStart(args);
await OnStart(config);
}
protected virtual async Task OnStart(Dictionary<string, string> args)
protected virtual async Task OnStart(IConfiguration config)
{
await Task.CompletedTask;
}

Loading…
Cancel
Save