Convert dictionary initialization to standard IConfig initialization

features/nuget_autobuild
Matija Koželj 2 years ago
parent 399cee2eac
commit 25f1563ef5

@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
namespace Connected; namespace Connected;
@ -7,6 +8,6 @@ public interface IStartup
{ {
void ConfigureServices(IServiceCollection services); void ConfigureServices(IServiceCollection services);
void Configure(WebApplication app); void Configure(WebApplication app);
Task Initialize(Dictionary<string, string> args); Task Initialize(IConfiguration config);
Task Start(Dictionary<string, string> args); Task Start(IConfiguration config);
} }

@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
namespace Connected; 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; 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; await Task.CompletedTask;
} }

Loading…
Cancel
Save