Skip to content

Commit b3ac5eb

Browse files
authored
Merge pull request #310 from Senparc/Develop
Develop
2 parents 12347f1 + ce8191f commit b3ac5eb

File tree

7 files changed

+162
-152
lines changed

7 files changed

+162
-152
lines changed

README.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,26 @@
99
[![NuGet](https://img.shields.io/nuget/dt/Senparc.CO2NET.svg)](https://www.nuget.org/packages/Senparc.CO2NET)
1010
[![license](https://img.shields.io/github/license/JeffreySu/WeiXinMPSDK.svg)](http://www.apache.org/licenses/LICENSE-2.0)
1111

12+
13+
Senparc.CO2NET is a common foundational extension library supporting .NET Framework and .NET Core, including basic helper classes needed for regular development.
14+
Developers can directly use CO2NET to provide common foundational methods for their projects, avoiding the pain of repeatedly preparing and maintaining common code.
15+
Senparc.CO2NET is already relied upon as the foundational library for Senparc series products such as [Senparc.Weixin SDK](https://github.com/JeffreySu/WeiXinMPSDK) and [NCF](https://github.com/NeuCharFramework/NCF).
16+
17+
1218
| Module Function | Nuget Name | Nuget | Supported .NET Versions |
1319
|-----------------|--------------------------------|-----------------------------------------------------------------------------------------|--------------------------------------------------|
14-
| CO2NET Base Library | Senparc.CO2NET | [![Senparc.CO2NET][1.1]][1.2] [![Senparc.CO2NET][nuget-img-base]][nuget-url-base] | ![.NET 3.5][net35N] ![.NET 4.0][net40N] ![.NET 4.6.2][net462Y] ![.NET Core 2.0][core20Y] |
15-
| MagicObject (New) | Senparc.CO2NET.MagicObject | [![Senparc.CO2NET.MagicObject][6.1]][6.2] [![Senparc.CO2NET.MagicObject][nuget-img-base-magic-object]][nuget-url-base-magic-object] | ![.NET 3.5][net35Y] ![.NET 4.0][net40Y] ![.NET 4.6.2][net462Y] ![.NET Core 2.0][core20Y] |
16-
| APM Module | Senparc.CO2NET.APM | [![Senparc.CO2NET.APM][2.1]][2.2] [![Senparc.CO2NET.APM][nuget-img-base-apm]][nuget-url-base-apm] | ![.NET 3.5][net35Y] ![.NET 4.0][net40Y] ![.NET 4.6.2][net462Y] ![.NET Core 2.0][core20Y] |
17-
| Redis Base Library | Senparc.CO2NET.Cache.Redis | [![Senparc.CO2NET.Cache.Redis][3.1]][3.2] [![Senparc.CO2NET.Cache.Redis][nuget-img-base-redis]][nuget-url-base-redis] | ![.NET 3.5][net35N] ![.NET 4.0][net40N] ![.NET 4.6.2][net462Y] ![.NET Core 2.0][core20Y] |
18-
| Memcached Base Library | Senparc.CO2NET.Cache.Memcached | [![Senparc.CO2NET.Cache.Memcached][4.1]][4.2] [![Senparc.CO2NET.Cache.Memcached][nuget-img-base-memcached]][nuget-url-base-memcached] | ![.NET 3.5][net35N] ![.NET 4.0][net40N] ![.NET 4.6.2][net462Y] ![.NET Core 2.0][core20Y] |
19-
| WebApi (New) | Senparc.CO2NET.WebApi | [![Senparc.CO2NET.WebApi][5.1]][5.2] | Supports .NET Standard 2.0+ and .NET Core 2.1/3.1, .NET 5.0/6.0/7.0/8.0+ > [!NOTE]> CO2NET will gradually stop supporting .NET Framework 4.0 and earlier versions.
20+
| CO2NET Base Library | Senparc.CO2NET | [![Senparc.CO2NET][1.1]][1.2] [![Senparc.CO2NET][nuget-img-base]][nuget-url-base] | ![.NET 3.5][net35Y] ![.NET 4.0][net40Y] ![.NET 4.6.2][net462Y] ![.NET Core 2.0][core20Y]
21+
| APM Module | Senparc.CO2NET.APM | [![Senparc.CO2NET.APM][2.1]][2.2] [![Senparc.CO2NET.APM][nuget-img-base-apm]][nuget-url-base-apm] | ![.NET 3.5][net35Y] ![.NET 4.0][net40Y] ![.NET 4.6.2][net462Y] ![.NET Core 2.0][core20Y]
22+
| Redis Base Library | Senparc.CO2NET.Cache.Redis | [![Senparc.CO2NET.Cache.Redis][3.1]][3.2] [![Senparc.CO2NET.Cache.Redis][nuget-img-base-redis]][nuget-url-base-redis] | ![.NET 3.5][net35N] ![.NET 4.0][net40N] ![.NET 4.6.2][net462Y] ![.NET Core 2.0][core20Y]
23+
| Memcached Base Library | Senparc.CO2NET.Cache.Memcached | [![Senparc.CO2NET.Cache.Memcached][4.1]][4.2] [![Senparc.CO2NET.Cache.Memcached][nuget-img-base-memcached]][nuget-url-base-memcached] | ![.NET 3.5][net35N] ![.NET 4.0][net40N] ![.NET 4.6.2][net462Y] ![.NET Core 2.0][core20Y]
24+
| WebApi (New) | Senparc.CO2NET.WebApi | [![Senparc.CO2NET.WebApi][5.1]][5.2] [![Senparc.CO2NET.WebApi][nuget-img-base-memcached]][nuget-url-base-memcached] | ![.NET 3.5][net35N] ![.NET 4.0][net40N] ![.NET 4.6.2][net462Y] ![.NET Core 2.0][core20Y]
25+
| MagicObject (New) | Senparc.CO2NET.MagicObject | [![Senparc.CO2NET.MagicObject][6.1]][6.2] [![Senparc.CO2NET.MagicObject][nuget-img-base-magic-object]][nuget-url-base-magic-object] | ![.NET 3.5][net35N] ![.NET 4.0][net40N] ![.NET 4.6.2][net462Y] ![.NET Core 2.0][core20Y]
26+
27+
28+
![.NET Core 2.0][core20Y] : Supports .NET Standard 2.0+ and .NET Core 2.1/3.1, .NET 5.0/6.0/7.0/8.0+
29+
30+
> [!NOTE]
31+
> CO2NET will gradually stop supporting .NET Framework 4.0 and earlier versions. Because the official update has stopped.
2032
2133
[1.1]: https://img.shields.io/nuget/v/Senparc.CO2NET.svg?style=flat
2234
[1.2]: https://www.nuget.org/packages/Senparc.CO2NET
@@ -64,16 +76,12 @@
6476
[nuget-img-base-magic-object]: https://img.shields.io/nuget/dt/Senparc.CO2NET.MagicObject.svg
6577
[nuget-url-base-magic-object]: https://www.nuget.org/packages/Senparc.CO2NET.MagicObject
6678

67-
Senparc.CO2NET is a common foundational extension library supporting .NET Framework and .NET Core, including basic helper classes needed for regular development.
68-
Developers can directly use CO2NET to provide common foundational methods for their projects, avoiding the pain of repeatedly preparing and maintaining common code.
69-
Senparc.CO2NET is already relied upon as the foundational library for Senparc series products such as [Senparc.Weixin SDK](https://github.com/JeffreySu/WeiXinMPSDK) and [NCF](https://github.com/NeuCharFramework/NCF).
70-
7179
## How to Install via Nuget?
7280
* CO2NET Nuget Address: https://www.nuget.org/packages/Senparc.CO2NET
73-
* Command:
81+
* Command:
7482
```shell
7583
PM> Install-Package Senparc.CO2NET
76-
84+
```
7785

7886
## Stages
7987
The currently released version is stable and continuously updated. You can follow the project's progress!

src/Senparc.CO2NET.Cache.CsRedis/ObjectCacheStrategy/RedisHashSetObjectCacheStrategy.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ public override Task<long> GetCountAsync()
480480

481481
public override Task<long> GetCountAsync(string prefix)
482482
{
483-
return Task.Factory.StartNew(() => GetCount(""));
483+
return Task.Factory.StartNew(() => GetCount(prefix));
484484
}
485485

486486
/// <summary>

src/Senparc.CO2NET.Cache.CsRedis/ObjectCacheStrategy/RedisObjectCacheStrategy.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ public override Task<long> GetCountAsync()
352352
}
353353
public override Task<long> GetCountAsync(string prefix)
354354
{
355-
return Task.Factory.StartNew(() => GetCount(""));
355+
return Task.Factory.StartNew(() => GetCount(prefix));
356356
}
357357
public override async Task SetAsync(string key, object value, TimeSpan? expiry = null, bool isFullKey = false)
358358
{
Lines changed: 64 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,76 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup>
3-
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
4-
<Version>2.0.0-beta1</Version>
5-
<AssemblyName>Senparc.CO2NET.Cache.CsRedis</AssemblyName>
6-
<RootNamespace>Senparc.CO2NET.Cache.CsRedis</RootNamespace>
7-
<GeneratePackageOnBuild Condition=" '$(Configuration)' == 'Release' ">true</GeneratePackageOnBuild>
8-
<Description>
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
4+
<Version>2.0.1-beta1</Version>
5+
<AssemblyName>Senparc.CO2NET.Cache.CsRedis</AssemblyName>
6+
<RootNamespace>Senparc.CO2NET.Cache.CsRedis</RootNamespace>
7+
<GeneratePackageOnBuild Condition=" '$(Configuration)' == 'Release' ">true</GeneratePackageOnBuild>
8+
<Description>
99
CONET cache strategy - Redis module
1010

1111
CO2NET open source project:
1212
https://github.com/Senparc/Senparc.CO2NET
1313
</Description>
14-
<Copyright>Senparc Copyright © 2004~2024</Copyright>
15-
<PackageTags>Senparc.CO2NET,Cache,Redis,CO2NET,盛派</PackageTags>
16-
<Authors>Jeffrey Su</Authors>
17-
<Owners>Senparc</Owners>
18-
<PackageLicenseUrl>https://github.com/JeffreySu/WeiXinMPSDK/blob/master/license.md</PackageLicenseUrl>
19-
<ProjectUrl>https://github.com/JeffreySu/WeiXinMPSDK</ProjectUrl>
20-
<Title>Senparc.CO2NET.Cache.CsRedis.dll</Title>
21-
<Summary>CsRedis Cache for CO2NET C#</Summary>
22-
<PackageProjectUrl>https://github.com/JeffreySu/WeiXinMPSDK</PackageProjectUrl>
23-
<PackageIcon>icon.jpg</PackageIcon>
24-
<PackageReleaseNotes>
14+
<Copyright>Senparc Copyright © 2004~2024</Copyright>
15+
<PackageTags>Senparc.CO2NET,Cache,Redis,CO2NET,盛派</PackageTags>
16+
<Authors>Jeffrey Su</Authors>
17+
<Owners>Senparc</Owners>
18+
<PackageLicenseUrl>https://github.com/JeffreySu/WeiXinMPSDK/blob/master/license.md</PackageLicenseUrl>
19+
<ProjectUrl>https://github.com/JeffreySu/WeiXinMPSDK</ProjectUrl>
20+
<Title>Senparc.CO2NET.Cache.CsRedis.dll</Title>
21+
<Summary>CsRedis Cache for CO2NET C#</Summary>
22+
<PackageProjectUrl>https://github.com/JeffreySu/WeiXinMPSDK</PackageProjectUrl>
23+
<PackageIcon>icon.jpg</PackageIcon>
24+
<PackageReleaseNotes>
2525
v0.1.0 Genesis
2626
v0.5.2 BaseRedisObjectCacheStrategy destructor performs null value check and adds "#{Cache_Redis_Configuration}#" filter check
2727
v1.1.4 RedisObjectCacheStrategy and RedisHashSetObjectCacheStrategy.Get() methods add pure string check
2828
v1.2.5 Fix bug where GetAllByPrefixAsync(key) method automatically retrieves all keys
2929
[2024-09-11] v1.2.6 Update Cache, remove InsertToCache(), add Count(prefix)
30+
[2024-10-24] v2.0.1-beta1 fix: GetCountAsync(string prefix) #306 Thanks to @rendyu
3031
</PackageReleaseNotes>
31-
<RepositoryUrl>https://github.com/Senparc/Senparc.CO2NET</RepositoryUrl>
32-
<Configurations>Debug;Release;Test</Configurations>
33-
</PropertyGroup>
34-
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
35-
<OutputPath>..\BuildOutPut</OutputPath>
36-
<DefineConstants>TRACE</DefineConstants>
37-
</PropertyGroup>
38-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
39-
<OutputPath>..\..\BuildOutPut</OutputPath>
40-
<DefineConstants>$(DefineConstants);RELEASE</DefineConstants>
41-
<DocumentationFile>..\BuildOutPut\Senparc.CO2NET.Cache.CsRedis.XML</DocumentationFile>
42-
<Optimize>true</Optimize>
43-
<DebugType>pdbonly</DebugType>
44-
<ErrorReport>prompt</ErrorReport>
45-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
46-
</PropertyGroup>
47-
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net462|AnyCPU'">
48-
<OutputPath>..\BuildOutPut\</OutputPath>
49-
<DocumentationFile>..\BuildOutPut\net462\Senparc.CO2NET.Cache.CsRedis.xml</DocumentationFile>
50-
</PropertyGroup>
51-
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netstandard2.0|AnyCPU'">
52-
<OutputPath>..\BuildOutPut\</OutputPath>
53-
<DocumentationFile>..\BuildOutPut\netstandard2.0\Senparc.CO2NET.Cache.CsRedis.xml</DocumentationFile>
54-
</PropertyGroup>
55-
<ItemGroup>
56-
<None Include="..\Senparc.CO2NET\icon.jpg" Pack="true" Visible="false" PackagePath="" />
57-
</ItemGroup>
58-
<ItemGroup>
59-
<Compile Remove="packages\**" />
60-
<Compile Remove="ServiceStack.Redis\**" />
61-
<EmbeddedResource Remove="packages\**" />
62-
<EmbeddedResource Remove="ServiceStack.Redis\**" />
63-
<None Remove="packages\**" />
64-
<None Remove="ServiceStack.Redis\**" />
65-
</ItemGroup>
66-
<ItemGroup>
67-
<!--<PackageReference Include="Senparc.CO2NET.Cache.Redis.RedLock" Version="0.1.0" />-->
68-
<PackageReference Include="BinaryFormatter" Version="2.1.4" />
69-
<PackageReference Include="CSRedisCore" Version="3.8.800" />
70-
</ItemGroup>
71-
<ItemGroup>
72-
<ProjectReference Include="..\Senparc.CO2NET.Cache.CsRedis.RedLock\redlock-cs\src\Senparc.CO2NET.Cache.CsRedis.RedLock.csproj" />
73-
<ProjectReference Include="..\Senparc.CO2NET\Senparc.CO2NET.csproj" />
74-
</ItemGroup>
32+
<RepositoryUrl>https://github.com/Senparc/Senparc.CO2NET</RepositoryUrl>
33+
<Configurations>Debug;Release;Test</Configurations>
34+
</PropertyGroup>
35+
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
36+
<OutputPath>..\BuildOutPut</OutputPath>
37+
<DefineConstants>TRACE</DefineConstants>
38+
</PropertyGroup>
39+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
40+
<OutputPath>..\..\BuildOutPut</OutputPath>
41+
<DefineConstants>$(DefineConstants);RELEASE</DefineConstants>
42+
<DocumentationFile>..\BuildOutPut\Senparc.CO2NET.Cache.CsRedis.XML</DocumentationFile>
43+
<Optimize>true</Optimize>
44+
<DebugType>pdbonly</DebugType>
45+
<ErrorReport>prompt</ErrorReport>
46+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
47+
</PropertyGroup>
48+
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net462|AnyCPU'">
49+
<OutputPath>..\BuildOutPut\</OutputPath>
50+
<DocumentationFile>..\BuildOutPut\net462\Senparc.CO2NET.Cache.CsRedis.xml</DocumentationFile>
51+
</PropertyGroup>
52+
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netstandard2.0|AnyCPU'">
53+
<OutputPath>..\BuildOutPut\</OutputPath>
54+
<DocumentationFile>..\BuildOutPut\netstandard2.0\Senparc.CO2NET.Cache.CsRedis.xml</DocumentationFile>
55+
</PropertyGroup>
56+
<ItemGroup>
57+
<None Include="..\Senparc.CO2NET\icon.jpg" Pack="true" Visible="false" PackagePath="" />
58+
</ItemGroup>
59+
<ItemGroup>
60+
<Compile Remove="packages\**" />
61+
<Compile Remove="ServiceStack.Redis\**" />
62+
<EmbeddedResource Remove="packages\**" />
63+
<EmbeddedResource Remove="ServiceStack.Redis\**" />
64+
<None Remove="packages\**" />
65+
<None Remove="ServiceStack.Redis\**" />
66+
</ItemGroup>
67+
<ItemGroup>
68+
<!--<PackageReference Include="Senparc.CO2NET.Cache.Redis.RedLock" Version="0.1.0" />-->
69+
<PackageReference Include="BinaryFormatter" Version="2.1.4" />
70+
<PackageReference Include="CSRedisCore" Version="3.8.800" />
71+
</ItemGroup>
72+
<ItemGroup>
73+
<ProjectReference Include="..\Senparc.CO2NET.Cache.CsRedis.RedLock\redlock-cs\src\Senparc.CO2NET.Cache.CsRedis.RedLock.csproj" />
74+
<ProjectReference Include="..\Senparc.CO2NET\Senparc.CO2NET.csproj" />
75+
</ItemGroup>
7576
</Project>

src/Senparc.CO2NET.Cache.Redis/ObjectCacheStrategy/RedisHashSetObjectCacheStrategy.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ public override Task<long> GetCountAsync()
485485
}
486486
public override Task<long> GetCountAsync(string prefix)
487487
{
488-
return Task.Factory.StartNew(() => GetCount(""));
488+
return Task.Factory.StartNew(() => GetCount(prefix));
489489
}
490490

491491
/// <summary>

src/Senparc.CO2NET.Cache.Redis/ObjectCacheStrategy/RedisObjectCacheStrategy.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ public override Task<long> GetCountAsync()
346346
}
347347
public override Task<long> GetCountAsync(string prefix)
348348
{
349-
return Task.Factory.StartNew(() => GetCount(""));
349+
return Task.Factory.StartNew(() => GetCount(prefix));
350350
}
351351

352352
public override async Task SetAsync(string key, object value, TimeSpan? expiry = null, bool isFullKey = false)

0 commit comments

Comments
 (0)