Convert OnInitialize stub to use standard IConfiguration for initialization

features/nuget_autobuild
Matija Koželj 2 years ago
parent fea7b6af42
commit dbcec2f299

@ -1,6 +1,7 @@
using Connected.Annotations; using Connected.Annotations;
using Connected.Caching.Net; using Connected.Caching.Net;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
[assembly: MicroService(MicroServiceType.Sys)] [assembly: MicroService(MicroServiceType.Sys)]
@ -24,7 +25,7 @@ internal class CachingStartup : Startup
services.AddScoped(typeof(ICacheContext), typeof(CacheContext)); services.AddScoped(typeof(ICacheContext), typeof(CacheContext));
} }
protected override async Task OnInitialize(Dictionary<string, string> args) protected override async Task OnInitialize(IConfiguration config)
{ {
if (Services is not null && Services.GetService<ICachingService>() is ICachingService service) if (Services is not null && Services.GetService<ICachingService>() is ICachingService service)
await service.Initialize(); await service.Initialize();

Loading…
Cancel
Save