Skip to content

Commit

Permalink
Merge pull request #22 from erenken/work/updateNet9
Browse files Browse the repository at this point in the history
Refactor DI configuration in IServiceCollectionExtensions
  • Loading branch information
erenken authored Dec 31, 2024
2 parents 1c659c3 + 5bf1bcc commit 9004bad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/myNOC.WeatherLink/IServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ public static IServiceCollection AddWeatherLink(this IServiceCollection services
services.AddSingleton<IObjectTypeInfoResolver, ObjectTypeInfoResolver>();
services.AddSingleton<IHighLowProcessor, HighLowProcessor>();

services.AddSingleton<IAPIHttpClient, APIHttpClient>();
services.AddSingleton(x => new SensorJsonConverterFactory(x.GetRequiredService<ISensorFactory>()));

services.AddScoped<ISensorFactory, SensorFactory>();
services.AddScoped(x => new SensorJsonConverterFactory(x.GetRequiredService<ISensorFactory>()));

services.AddSingleton<IAPIHttpClient, APIHttpClient>();
services.AddScoped<IAPIRepository, APIRepository>();
services.AddScoped<IClient, Client>();
services.AddAllScoped(typeof(ISensorData));
Expand Down

0 comments on commit 9004bad

Please sign in to comment.