diff --git a/DistributedResponseCachingMiddleware/Custom/CustomResponseCachingServiceExtensions.cs b/DistributedResponseCachingMiddleware/Custom/CustomResponseCachingServiceExtensions.cs index 9dd772f..b5f7660 100644 --- a/DistributedResponseCachingMiddleware/Custom/CustomResponseCachingServiceExtensions.cs +++ b/DistributedResponseCachingMiddleware/Custom/CustomResponseCachingServiceExtensions.cs @@ -48,7 +48,15 @@ public static IServiceCollection AddResponseCaching(this IServiceCollection serv var options = new CustomResponseCachingOptions(); configureOptions(options); + services.Configure(configureOptions); + services.Configure(baseOptions => + { + baseOptions.SizeLimit = options.SizeLimit; + baseOptions.MaximumBodySize = options.MaximumBodySize; + baseOptions.UseCaseSensitivePaths = options.UseCaseSensitivePaths; + baseOptions.SystemClock = options.SystemClock; + }); _ = options.ResponseCachingStrategy switch { @@ -62,6 +70,10 @@ public static IServiceCollection AddResponseCaching(this IServiceCollection serv { services.AddCacheAuthorizedRequestsResponseCachingPolicy(); } + else + { + services.AddSingleton(); + } services.AddResponseCaching(); return services; } diff --git a/DistributedResponseCachingMiddleware/DistributedResponseCachingMiddleware.csproj b/DistributedResponseCachingMiddleware/DistributedResponseCachingMiddleware.csproj index 33851a6..f1e692f 100644 --- a/DistributedResponseCachingMiddleware/DistributedResponseCachingMiddleware.csproj +++ b/DistributedResponseCachingMiddleware/DistributedResponseCachingMiddleware.csproj @@ -1,9 +1,9 @@  - netcoreapp3.1 + net6.0 Latest - 3.0.2 + 6.0.0-rc.2 An alternative to Microsoft.AspNetCore.ResponseCaching, which supports IDistributedCache, allows custom reponse caches, and provides a modifiable distributed response cache, which uses an injecting distributed cache, and options which allow clearing or ignoring the cache. It uses Microsoft.AspNetCore.ResponseCaching internally (via git submodule and linking in csproj) @@ -33,18 +33,21 @@ It uses Microsoft.AspNetCore.ResponseCaching internally (via git submodule and l + + <_Parameter1>DistributedResponseCachingMiddlewareTests + %(RecursiveDir)%(Filename)%(Extension) - - - - - - + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/DistributedResponseCachingMiddlewareTests/DistributedResponseCacheTests.cs b/DistributedResponseCachingMiddlewareTests/DistributedResponseCacheTests.cs index 007b5fc..6d68c56 100644 --- a/DistributedResponseCachingMiddlewareTests/DistributedResponseCacheTests.cs +++ b/DistributedResponseCachingMiddlewareTests/DistributedResponseCacheTests.cs @@ -1,17 +1,17 @@ -using NUnit.Framework; -using Moq; +using ExternalNetcoreExtensions.Distributed; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.ResponseCaching; using Microsoft.Extensions.Caching.Distributed; -using Microsoft.AspNetCore.ResponseCaching.Internal; +using Microsoft.Extensions.Caching.Memory; +using Microsoft.Extensions.Options; +using Microsoft.Extensions.Primitives; +using Moq; +using NUnit.Framework; using System; -using System.IO; -using Microsoft.AspNetCore.Http; using System.Collections.Generic; -using Microsoft.Extensions.Primitives; -using System.Threading; -using ExternalNetcoreExtensions.Distributed; +using System.IO; using System.Text; -using Microsoft.Extensions.Caching.Memory; -using Microsoft.Extensions.Options; +using System.Threading; namespace DistributedResponseCachingMiddlewareTests { diff --git a/DistributedResponseCachingMiddlewareTests/DistributedResponseCachingMiddlewareTests.csproj b/DistributedResponseCachingMiddlewareTests/DistributedResponseCachingMiddlewareTests.csproj index 6c666b6..f77b723 100644 --- a/DistributedResponseCachingMiddlewareTests/DistributedResponseCachingMiddlewareTests.csproj +++ b/DistributedResponseCachingMiddlewareTests/DistributedResponseCachingMiddlewareTests.csproj @@ -1,18 +1,18 @@  - netcoreapp3.1 + net6.0 false Latest - - - - - + + + + + diff --git a/WeatherApi/WeatherApi.csproj b/WeatherApi/WeatherApi.csproj index 9a3eeb0..a4a5e55 100644 --- a/WeatherApi/WeatherApi.csproj +++ b/WeatherApi/WeatherApi.csproj @@ -1,11 +1,11 @@ - netcoreapp3.1 + net6.0 - +