Skip to content

Commit 62885a2

Browse files
committed
opt: 移除目标框架 net6.0 net7.0, 添加 net9.0 net10.0; 代码细节优化、测试细节优化;
1 parent db6517b commit 62885a2

40 files changed

+213
-246
lines changed

.editorconfig

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,8 @@ end_of_line = crlf
77
indent_style = space
88
insert_final_newline = true
99
trim_trailing_whitespace = true
10-
dotnet_style_qualification_for_field = false:silent
11-
dotnet_style_qualification_for_property = false:silent
12-
dotnet_style_qualification_for_method = false:silent
13-
dotnet_style_qualification_for_event = false:silent
14-
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
15-
indent_size = 4
16-
tab_width = 4
17-
dotnet_style_operator_placement_when_wrapping = beginning_of_line
10+
indent_size = 2
11+
tab_width = 2
1812

1913
# c# 文件
2014
[*.cs]
@@ -119,6 +113,7 @@ csharp_style_prefer_readonly_struct = true
119113
# 代码块首选项
120114
csharp_prefer_braces = true:silent
121115
csharp_prefer_simple_using_statement = true:suggestion
116+
csharp_prefer_system_threading_lock = true:suggestion
122117
csharp_style_namespace_declarations = file_scoped:suggestion
123118
csharp_style_prefer_method_group_conversion = true:silent
124119
csharp_style_prefer_top_level_statements = true:silent
@@ -134,6 +129,7 @@ csharp_style_prefer_null_check_over_type_check = true
134129
csharp_style_prefer_range_operator = true
135130
csharp_style_prefer_tuple_swap = true
136131
csharp_style_prefer_utf8_string_literals = true
132+
csharp_style_prefer_primary_constructors = true:suggestion
137133
csharp_style_throw_expression = true
138134
csharp_style_unused_value_assignment_preference = discard_variable
139135
csharp_style_unused_value_expression_statement_preference = discard_variable
@@ -300,7 +296,3 @@ dotnet_naming_style.以_为前缀.required_prefix = _
300296
dotnet_naming_style.以_为前缀.required_suffix =
301297
dotnet_naming_style.以_为前缀.word_separator =
302298
dotnet_naming_style.以_为前缀.capitalization = camel_case
303-
304-
[*.{csproj,props}]
305-
indent_size = 2
306-
tab_width = 2

.github/workflows/PublishNugetPackage.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,19 @@ jobs:
99
publish-with-build:
1010

1111
runs-on: ubuntu-latest
12-
12+
13+
permissions:
14+
id-token: write
15+
1316
steps:
14-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v6
1518
- name: Setup .NET Core SDK
16-
uses: actions/setup-dotnet@v3
19+
uses: actions/setup-dotnet@v5
1720
with:
18-
dotnet-version: '8.0.x'
21+
dotnet-version: |
22+
8.x
23+
9.x
24+
10.x
1925
- name: build - main
2026
run: dotnet build -c Release ./src/Cuture.AspNetCore.ResponseCaching/Cuture.AspNetCore.ResponseCaching.csproj
2127
- name: build - redis
@@ -26,7 +32,14 @@ jobs:
2632
run: dotnet user-secrets set 'ResponseCache_Test_Redis' '127.0.0.1:6379,allowAdmin=true' -p ./test/ResponseCaching.Test.WebHost/ResponseCaching.Test.WebHost.csproj && dotnet test -c Release
2733
- name: pack
2834
run: dotnet pack -c Release -o ./output --include-symbols
35+
36+
- name: NuGet login
37+
uses: NuGet/login@v1
38+
id: login
39+
with:
40+
user: ${{ secrets.NUGET_USER }}
41+
2942
- name: push package
3043
shell: pwsh
3144
working-directory: ./output
32-
run: Get-ChildItem -File -Filter '*.nupkg' | ForEach-Object { dotnet nuget push $_ -k ${{secrets.NUGET_KEY}} -s https://api.nuget.org/v3/index.json --no-service-endpoint --skip-duplicate; dotnet nuget push $_ -k ${{secrets.NUGET_GITHUB_KEY}} -s https://nuget.pkg.github.com/StratosBlue/index.json --no-service-endpoint --skip-duplicate; }
45+
run: Get-ChildItem -File -Filter '*.nupkg' | ForEach-Object { dotnet nuget push $_ -k ${{steps.login.outputs.NUGET_API_KEY}} -s https://api.nuget.org/v3/index.json --no-service-endpoint --skip-duplicate; dotnet nuget push $_ -k ${{secrets.NUGET_GITHUB_KEY}} -s https://nuget.pkg.github.com/StratosBlue/index.json --no-service-endpoint --skip-duplicate; }

.gitignore

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,25 @@
1313
# User-specific files (MonoDevelop/Xamarin Studio)
1414
*.userprefs
1515

16+
# Mono auto generated files
17+
mono_crash.*
18+
1619
# Build results
1720
[Dd]ebug/
1821
[Dd]ebugPublic/
1922
[Rr]elease/
2023
[Rr]eleases/
2124
x64/
2225
x86/
26+
[Ww][Ii][Nn]32/
2327
[Aa][Rr][Mm]/
2428
[Aa][Rr][Mm]64/
2529
bld/
2630
[Bb]in/
2731
[Oo]bj/
32+
[Oo]ut/
2833
[Ll]og/
34+
[Ll]ogs/
2935

3036
# Visual Studio 2015/2017 cache/options directory
3137
.vs/
@@ -39,9 +45,10 @@ Generated\ Files/
3945
[Tt]est[Rr]esult*/
4046
[Bb]uild[Ll]og.*
4147

42-
# NUNIT
48+
# NUnit
4349
*.VisualState.xml
4450
TestResult.xml
51+
nunit-*.xml
4552

4653
# Build Results of an ATL Project
4754
[Dd]ebugPS/
@@ -56,6 +63,9 @@ project.lock.json
5663
project.fragment.lock.json
5764
artifacts/
5865

66+
# ASP.NET Scaffolding
67+
ScaffoldingReadMe.txt
68+
5969
# StyleCop
6070
StyleCopReport.xml
6171

@@ -122,9 +132,6 @@ _ReSharper*/
122132
*.[Rr]e[Ss]harper
123133
*.DotSettings.user
124134

125-
# JustCode is a .NET coding add-in
126-
.JustCode
127-
128135
# TeamCity is a build add-in
129136
_TeamCity*
130137

@@ -135,6 +142,11 @@ _TeamCity*
135142
.axoCover/*
136143
!.axoCover/settings.json
137144

145+
# Coverlet is a free, cross platform Code Coverage Tool
146+
coverage*.json
147+
coverage*.xml
148+
coverage*.info
149+
138150
# Visual Studio code coverage results
139151
*.coverage
140152
*.coveragexml
@@ -182,6 +194,7 @@ PublishScripts/
182194

183195
# NuGet Packages
184196
*.nupkg
197+
# NuGet Symbol Packages
185198
*.snupkg
186199
# The packages folder can be ignored because of Package Restore
187200
**/[Pp]ackages/*
@@ -207,6 +220,8 @@ BundleArtifacts/
207220
Package.StoreAssociation.xml
208221
_pkginfo.txt
209222
*.appx
223+
*.appxbundle
224+
*.appxupload
210225

211226
# Visual Studio cache files
212227
# files ending in .cache can be ignored
@@ -256,7 +271,9 @@ ServiceFabricBackup/
256271
*.bim.layout
257272
*.bim_*.settings
258273
*.rptproj.rsuser
259-
*- Backup*.rdl
274+
*- [Bb]ackup.rdl
275+
*- [Bb]ackup ([0-9]).rdl
276+
*- [Bb]ackup ([0-9][0-9]).rdl
260277

261278
# Microsoft Fakes
262279
FakesAssemblies/
@@ -292,10 +309,6 @@ paket-files/
292309
# FAKE - F# Make
293310
.fake/
294311

295-
# JetBrains Rider
296-
.idea/
297-
*.sln.iml
298-
299312
# CodeRush personal settings
300313
.cr/personal
301314

@@ -338,4 +351,13 @@ ASALocalRun/
338351
.localhistory/
339352

340353
# BeatPulse healthcheck temp database
341-
healthchecksdb
354+
healthchecksdb
355+
356+
# Backup folder for Package Reference Convert tool in Visual Studio 2017
357+
MigrationBackup/
358+
359+
# Ionide (cross platform F# VS Code tools) working folder
360+
.ionide/
361+
362+
# Fody - auto-generated XML schema
363+
FodyWeavers.xsd

Cuture.AspNetCore.ResponseCaching.sln

Lines changed: 0 additions & 63 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<Solution>
2+
<Folder Name="/Solution Items/">
3+
<File Path=".editorconfig" />
4+
<File Path=".gitignore" />
5+
<File Path="Directory.Build.props" />
6+
<File Path="flow_of_execution.md" />
7+
<File Path="global.json" />
8+
<File Path="LICENSE" />
9+
<File Path="package.props" />
10+
<File Path="readme.md" />
11+
</Folder>
12+
<Folder Name="/Solution Items/.github/" />
13+
<Folder Name="/Solution Items/.github/workflows/">
14+
<File Path=".github/workflows/PublishNugetPackage.yml" />
15+
</Folder>
16+
<Folder Name="/src/">
17+
<Project Path="src/Cuture.AspNetCore.ResponseCaching.StackExchange.Redis/Cuture.AspNetCore.ResponseCaching.StackExchange.Redis.csproj" />
18+
<Project Path="src/Cuture.AspNetCore.ResponseCaching/Cuture.AspNetCore.ResponseCaching.csproj" />
19+
</Folder>
20+
<Folder Name="/test/">
21+
<Project Path="test/ResponseCaching.Test.WebHost/ResponseCaching.Test.WebHost.csproj" />
22+
<Project Path="test/ResponseCaching.Test/ResponseCaching.Test.csproj" />
23+
</Folder>
24+
</Solution>

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>net6.0;net7.0;net8.0</TargetFrameworks>
3+
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
44

55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 StratosBlue
3+
Copyright (c) 2026 Stratos
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

global.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"msbuild-sdks": {
3+
"MSTest.Sdk": "4.0.2"
4+
},
5+
"test": {
6+
"runner": "Microsoft.Testing.Platform"
7+
}
8+
}

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.2.0</VersionPrefix>
9+
<VersionPrefix>2.3.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`版本要求 - `6.0`以上;
15+
- `Asp.net Core`版本要求 - `8.0`以上;
1616
- `Diagnostics`支持;
1717
- [执行流程概览](/flow_of_execution.md)
1818

0 commit comments

Comments
 (0)