Skip to content

Commit f592cf2

Browse files
committed
add tfm net8.0; remove tfm netcoreapp3.1 and net5.0;
1 parent 7ed6c8b commit f592cf2

File tree

18 files changed

+56
-72
lines changed

18 files changed

+56
-72
lines changed

.github/workflows/PublishNugetPackage.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@ jobs:
1515
- name: Setup .NET Core SDK
1616
uses: actions/setup-dotnet@v3
1717
with:
18-
dotnet-version: |
19-
3.x
20-
5.x
21-
6.x
22-
7.x
18+
dotnet-version: '8.0.x'
2319
- name: build - main
2420
run: dotnet build -c Release ./src/Cuture.AspNetCore.ResponseCaching/Cuture.AspNetCore.ResponseCaching.csproj
2521
- name: build - redis

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0</TargetFrameworks>
3+
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
44

55
<Nullable>enable</Nullable>
66

package.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<!--Package Info-->
88
<PropertyGroup>
9-
<VersionPrefix>2.0.2</VersionPrefix>
9+
<VersionPrefix>2.1.0</VersionPrefix>
1010
<!--<VersionSuffix>beta-05</VersionSuffix>-->
1111

1212
<Description>The `asp.net core` server-side caching component implemented based on `ResourceFilter` and `ActionFilter`; 基于`ResourceFilter`和`ActionFilter`实现的`asp.net core`服务端缓存组件</Description>

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The `asp.net core` server-side caching component implemented based on `ResourceF
1212
- 已实现基于`Memory``Redis`(StackExchange.Redis)的缓存,可拓展;
1313
- 默认缓存Key生成器会包含请求路径为缓存Key;
1414
- 默认缓存Key是大小写不敏感(强制转换为小写)的;
15-
- `Asp.net Core`版本要求 - `3.1`以上;
15+
- `Asp.net Core`版本要求 - `6.0`以上;
1616
- `Diagnostics`支持;
1717
- [执行流程概览](/flow_of_execution.md)
1818

src/Cuture.AspNetCore.ResponseCaching.StackExchange.Redis/Cuture.AspNetCore.ResponseCaching.StackExchange.Redis.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</PropertyGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="StackExchange.Redis" Version="2.6.111" />
15+
<PackageReference Include="StackExchange.Redis" Version="2.7.4" />
1616
</ItemGroup>
1717
<ItemGroup>
1818
<ProjectReference Include="..\Cuture.AspNetCore.ResponseCaching\Cuture.AspNetCore.ResponseCaching.csproj" />

src/Cuture.AspNetCore.ResponseCaching.StackExchange.Redis/ResponseCaches/RedisResponseCache.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public RedisResponseCache(IOptions<RedisResponseCacheOptions> optionAccessor)
8181
{
8282
return null;
8383
}
84-
return new ResponseCacheEntry(redisValues[0], redisValues[1], expire);
84+
return new ResponseCacheEntry(redisValues[0]!, redisValues[1], expire);
8585
}
8686

8787
/// <inheritdoc/>

src/Cuture.AspNetCore.ResponseCaching.StackExchange.Redis/ResponseCachingServicesExtensions.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ public static ResponseCachingServiceBuilder UseRedisResponseCache(this ResponseC
5454
public static ResponseCachingServiceBuilder UseRedisResponseCache(this ResponseCachingServiceBuilder builder, IConfiguration configuration)
5555
{
5656
var connectionConfiguration = configuration.GetValue<string>(nameof(RedisResponseCacheOptions.Configuration));
57+
if (string.IsNullOrWhiteSpace(connectionConfiguration))
58+
{
59+
throw new ArgumentException("Can not find the redis connection string at section 'Configuration'.", nameof(configuration));
60+
}
5761
var cacheKeyPrefix = configuration.GetValue<string>(nameof(RedisResponseCacheOptions.CacheKeyPrefix));
5862
var connectionMultiplexer = ConnectionMultiplexer.Connect(connectionConfiguration);
5963
return builder.UseRedisResponseCache(connectionMultiplexer, cacheKeyPrefix);

src/Cuture.AspNetCore.ResponseCaching/Attributes/CacheKeyGeneratorAttribute.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@ public class CacheKeyGeneratorAttribute : Attribute, ICacheKeyGeneratorMetadata
3838
/// <param name="filterType"></param>
3939
public CacheKeyGeneratorAttribute(Type type, FilterType filterType)
4040
{
41-
if (type is null)
42-
{
43-
throw new ArgumentNullException(nameof(type));
44-
}
41+
ArgumentNullException.ThrowIfNull(type);
4542

4643
CacheKeyGeneratorType = Checks.ThrowIfNotICacheKeyGenerator(type);
4744
FilterType = filterType;

src/Cuture.AspNetCore.ResponseCaching/Attributes/CacheModelKeyParserAttribute.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ public class CacheModelKeyParserAttribute : Attribute, ICacheModelKeyParserMetad
3131
/// </param>
3232
public CacheModelKeyParserAttribute(Type type)
3333
{
34-
if (type is null)
35-
{
36-
throw new ArgumentNullException(nameof(type));
37-
}
34+
ArgumentNullException.ThrowIfNull(type);
3835

3936
ModelKeyParserType = Checks.ThrowIfNotIModelKeyParser(type);
4037
}

src/Cuture.AspNetCore.ResponseCaching/Context/ResponseCachingContext.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,7 @@ public ResponseCachingContext(EndpointMetadataCollection metadatas,
117117
InterceptorAggregator interceptorAggregator,
118118
int dumpStreamCapacity)
119119
{
120-
if (metadatas is null)
121-
{
122-
throw new ArgumentNullException(nameof(metadatas));
123-
}
120+
ArgumentNullException.ThrowIfNull(metadatas);
124121

125122
MaxCacheableResponseLength = Checks.ThrowIfMaxCacheableResponseLengthTooSmall(Metadata<IMaxCacheableResponseLengthMetadata>()?.MaxCacheableResponseLength ?? options.MaxCacheableResponseLength);
126123

0 commit comments

Comments
 (0)