diff --git a/AS1024.GeoFeed.Core.SqliteGeoFeedCache/GeoFeedSqliteCache.cs b/AS1024.GeoFeed.Core.SqliteGeoFeedCache/GeoFeedSqliteCache.cs index e418f08..53255c1 100644 --- a/AS1024.GeoFeed.Core.SqliteGeoFeedCache/GeoFeedSqliteCache.cs +++ b/AS1024.GeoFeed.Core.SqliteGeoFeedCache/GeoFeedSqliteCache.cs @@ -1,8 +1,8 @@ using AS1024.GeoFeed.Core.Interfaces; +using AS1024.GeoFeed.Core.Tools; using AS1024.GeoFeed.Models; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Hosting; -using AS1024.GeoFeed.Core.Tools; namespace AS1024.GeoFeed.Core.GeoFeedSqliteLocalCache { diff --git a/AS1024.GeoFeed.Core.WebLogic/GeoFeedRetrurn.cs b/AS1024.GeoFeed.Core.WebLogic/GeoFeedRetrurn.cs index a17944e..cc92493 100644 --- a/AS1024.GeoFeed.Core.WebLogic/GeoFeedRetrurn.cs +++ b/AS1024.GeoFeed.Core.WebLogic/GeoFeedRetrurn.cs @@ -1,8 +1,8 @@ -using System.Text; -using AS1024.GeoFeed.Core.Interfaces; +using AS1024.GeoFeed.Core.Interfaces; using AS1024.GeoFeed.Core.Tools; using AS1024.GeoFeed.Models; using Microsoft.Extensions.Caching.Memory; +using System.Text; namespace AS1024.GeoFeed.Core.WebLogic { diff --git a/AS1024.GeoFeed.Core/CacheService/GeoFeedCacheService.cs b/AS1024.GeoFeed.Core/CacheService/GeoFeedCacheService.cs index 2570aae..4f85202 100644 --- a/AS1024.GeoFeed.Core/CacheService/GeoFeedCacheService.cs +++ b/AS1024.GeoFeed.Core/CacheService/GeoFeedCacheService.cs @@ -39,7 +39,7 @@ namespace AS1024.GeoFeed.Core.CacheService { var scope = host.Services.CreateScope(); - var persistentCacheProvider = + var persistentCacheProvider = scope.ServiceProvider.GetRequiredService(); var results = await feedProvider.GetGeoFeedDataAsync(); diff --git a/AS1024.GeoFeed.Core/CacheService/GeoFeedLocalFileCache.cs b/AS1024.GeoFeed.Core/CacheService/GeoFeedLocalFileCache.cs index b258ee6..842d4af 100644 --- a/AS1024.GeoFeed.Core/CacheService/GeoFeedLocalFileCache.cs +++ b/AS1024.GeoFeed.Core/CacheService/GeoFeedLocalFileCache.cs @@ -1,13 +1,7 @@ using AS1024.GeoFeed.Core.Interfaces; -using AS1024.GeoFeed.Models; using AS1024.GeoFeed.Core.Tools; +using AS1024.GeoFeed.Models; using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Hosting; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Microsoft.Extensions.Logging; namespace AS1024.GeoFeed.Core.CacheService diff --git a/AS1024.GeoFeed.Core/GeoFeedProviders/NetBoxGeoFeedProvider.cs b/AS1024.GeoFeed.Core/GeoFeedProviders/NetBoxGeoFeedProvider.cs index b5c7014..85a6114 100644 --- a/AS1024.GeoFeed.Core/GeoFeedProviders/NetBoxGeoFeedProvider.cs +++ b/AS1024.GeoFeed.Core/GeoFeedProviders/NetBoxGeoFeedProvider.cs @@ -6,7 +6,7 @@ namespace AS1024.GeoFeed.Core.GeoFeedProviders { public class NetBoxGeoFeedProvider : NetBoxGeoFeedProviderBase, IGeoFeedProvider { - public NetBoxGeoFeedProvider(IConfiguration configuration, ILogger logger, IHttpClientFactory httpClientFactory) + public NetBoxGeoFeedProvider(IConfiguration configuration, ILogger logger, IHttpClientFactory httpClientFactory) : base(configuration, logger, httpClientFactory) { } diff --git a/AS1024.GeoFeed.Core/GeoFeedProviders/NetBoxGeoFeedProviderBase.cs b/AS1024.GeoFeed.Core/GeoFeedProviders/NetBoxGeoFeedProviderBase.cs index 3b4899e..c52c3ea 100644 --- a/AS1024.GeoFeed.Core/GeoFeedProviders/NetBoxGeoFeedProviderBase.cs +++ b/AS1024.GeoFeed.Core/GeoFeedProviders/NetBoxGeoFeedProviderBase.cs @@ -1,11 +1,11 @@ using AS1024.GeoFeed.Core.Interfaces; using AS1024.GeoFeed.Models; -using System.Text.Json; -using System.Net.Http.Headers; -using System.Net.Sockets; -using System.Web; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; +using System.Net.Http.Headers; +using System.Net.Sockets; +using System.Text.Json; +using System.Web; namespace AS1024.GeoFeed.Core.GeoFeedProviders { diff --git a/AS1024.GeoFeed.Core/Interfaces/IGeoFeedCacheProvider.cs b/AS1024.GeoFeed.Core/Interfaces/IGeoFeedCacheProvider.cs index 9a0f69b..4f756f5 100644 --- a/AS1024.GeoFeed.Core/Interfaces/IGeoFeedCacheProvider.cs +++ b/AS1024.GeoFeed.Core/Interfaces/IGeoFeedCacheProvider.cs @@ -1,9 +1,4 @@ using AS1024.GeoFeed.Models; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace AS1024.GeoFeed.Core.Interfaces { diff --git a/AS1024.GeoFeed.MinimalAPI/Program.cs b/AS1024.GeoFeed.MinimalAPI/Program.cs index 74e662b..43716fe 100644 --- a/AS1024.GeoFeed.MinimalAPI/Program.cs +++ b/AS1024.GeoFeed.MinimalAPI/Program.cs @@ -19,16 +19,19 @@ namespace AS1024.GeoFeed.MinimalAPI builder.Services.AddMemoryCache(); builder.Services.AddLogging(); builder.Services.AddHttpClient(); - builder.Services.ConfigureHttpJsonOptions(options => { + builder.Services.ConfigureHttpJsonOptions(options => + { options.SerializerOptions.TypeInfoResolverChain.Insert(0, AppJsonSerializerContext.Default); }); var app = builder.Build(); - app.Map("/geofeed.csv", async (GeoFeedReturn feedReturn) => { + app.Map("/geofeed.csv", async (GeoFeedReturn feedReturn) => + { return await feedReturn.GetGeoFeed(); }); - app.Map("/geofeed", async (GeoFeedReturn feedReturn) => { + app.Map("/geofeed", async (GeoFeedReturn feedReturn) => + { return await feedReturn.GetGeoFeed(); }); diff --git a/AS1024.GeoFeed.Models/GeoFeed.cs b/AS1024.GeoFeed.Models/GeoFeed.cs index 3f9481e..a582e8e 100644 --- a/AS1024.GeoFeed.Models/GeoFeed.cs +++ b/AS1024.GeoFeed.Models/GeoFeed.cs @@ -1,11 +1,10 @@ -using System.Text.Json.Serialization; -namespace AS1024.GeoFeed.Models +namespace AS1024.GeoFeed.Models { public class NetboxData { public List? Results { get; set; } public string? Next { get; set; } - public string? Previous { get; set; } + public string? Previous { get; set; } } public class Result @@ -41,7 +40,8 @@ namespace AS1024.GeoFeed.Models /// /// This class represents the IP GeoFeed Entry /// - public class IPGeoFeed : CustomFields { + public class IPGeoFeed : CustomFields + { /// /// Represents the IP Prefix for the associated GeoFeed entry /// diff --git a/AS1024.GeoFeed/Controllers/GeofeedController.cs b/AS1024.GeoFeed/Controllers/GeofeedController.cs index e293ce2..d95d0af 100644 --- a/AS1024.GeoFeed/Controllers/GeofeedController.cs +++ b/AS1024.GeoFeed/Controllers/GeofeedController.cs @@ -1,5 +1,5 @@ -using Microsoft.AspNetCore.Mvc; -using AS1024.GeoFeed.Core.WebLogic; +using AS1024.GeoFeed.Core.WebLogic; +using Microsoft.AspNetCore.Mvc; namespace AS1024.GeoFeed.Controllers { diff --git a/AS1024.GeoFeed/Program.cs b/AS1024.GeoFeed/Program.cs index ba98d81..f1e136c 100644 --- a/AS1024.GeoFeed/Program.cs +++ b/AS1024.GeoFeed/Program.cs @@ -1,10 +1,10 @@ -using AS1024.GeoFeed.Core.Interfaces; +using AS1024.GeoFeed.Core.CacheService; using AS1024.GeoFeed.Core.GeoFeedPreloader; using AS1024.GeoFeed.Core.GeoFeedProviders; -using Microsoft.EntityFrameworkCore; using AS1024.GeoFeed.Core.GeoFeedSqliteLocalCache; -using AS1024.GeoFeed.Core.CacheService; +using AS1024.GeoFeed.Core.Interfaces; using AS1024.GeoFeed.Core.WebLogic; +using Microsoft.EntityFrameworkCore; namespace AS1024.GeoFeed {