Skip to content

Commit

Permalink
Merge pull request #21 from erenken/work/updateNet9
Browse files Browse the repository at this point in the history
Change ISensorFactory registration to scoped lifetime
  • Loading branch information
erenken authored Dec 31, 2024
2 parents 3d9be6b + 930b0df commit 1c659c3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/myNOC.WeatherLink/IServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ public static IServiceCollection AddWeatherLink(this IServiceCollection services
services.AddSingleton<IHighLowProcessor, HighLowProcessor>();

services.AddSingleton<IAPIHttpClient, APIHttpClient>();
services.AddSingleton<ISensorFactory, SensorFactory>();

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

services.AddScoped<ISensorFactory, SensorFactory>();
services.AddScoped<IAPIRepository, APIRepository>();
services.AddScoped<IClient, Client>();
services.AddAllScoped(typeof(ISensorData));
Expand Down

0 comments on commit 1c659c3

Please sign in to comment.