Skip to content

Commit

Permalink
Merge pull request #310 from Senparc/Develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
JeffreySu authored Oct 24, 2024
2 parents 12347f1 + ce8191f commit b3ac5eb
Show file tree
Hide file tree
Showing 7 changed files with 162 additions and 152 deletions.
32 changes: 20 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,26 @@
[![NuGet](https://img.shields.io/nuget/dt/Senparc.CO2NET.svg)](https://www.nuget.org/packages/Senparc.CO2NET)
[![license](https://img.shields.io/github/license/JeffreySu/WeiXinMPSDK.svg)](http://www.apache.org/licenses/LICENSE-2.0)


Senparc.CO2NET is a common foundational extension library supporting .NET Framework and .NET Core, including basic helper classes needed for regular development.
Developers can directly use CO2NET to provide common foundational methods for their projects, avoiding the pain of repeatedly preparing and maintaining common code.
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).


| Module Function | Nuget Name | Nuget | Supported .NET Versions |
|-----------------|--------------------------------|-----------------------------------------------------------------------------------------|--------------------------------------------------|
| 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] |
| 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] |
| 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] |
| 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] |
| 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] |
| 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.
| 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]
| 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]
| 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]
| 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]
| 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]
| 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]


![.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+

> [!NOTE]
> CO2NET will gradually stop supporting .NET Framework 4.0 and earlier versions. Because the official update has stopped.
[1.1]: https://img.shields.io/nuget/v/Senparc.CO2NET.svg?style=flat
[1.2]: https://www.nuget.org/packages/Senparc.CO2NET
Expand Down Expand Up @@ -64,16 +76,12 @@
[nuget-img-base-magic-object]: https://img.shields.io/nuget/dt/Senparc.CO2NET.MagicObject.svg
[nuget-url-base-magic-object]: https://www.nuget.org/packages/Senparc.CO2NET.MagicObject

Senparc.CO2NET is a common foundational extension library supporting .NET Framework and .NET Core, including basic helper classes needed for regular development.
Developers can directly use CO2NET to provide common foundational methods for their projects, avoiding the pain of repeatedly preparing and maintaining common code.
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).

## How to Install via Nuget?
* CO2NET Nuget Address: https://www.nuget.org/packages/Senparc.CO2NET
* Command:
* Command:
```shell
PM> Install-Package Senparc.CO2NET

```

## Stages
The currently released version is stable and continuously updated. You can follow the project's progress!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ public override Task<long> GetCountAsync()

public override Task<long> GetCountAsync(string prefix)
{
return Task.Factory.StartNew(() => GetCount(""));
return Task.Factory.StartNew(() => GetCount(prefix));
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ public override Task<long> GetCountAsync()
}
public override Task<long> GetCountAsync(string prefix)
{
return Task.Factory.StartNew(() => GetCount(""));
return Task.Factory.StartNew(() => GetCount(prefix));
}
public override async Task SetAsync(string key, object value, TimeSpan? expiry = null, bool isFullKey = false)
{
Expand Down
127 changes: 64 additions & 63 deletions src/Senparc.CO2NET.Cache.CsRedis/Senparc.CO2NET.Cache.CsRedis.csproj
Original file line number Diff line number Diff line change
@@ -1,75 +1,76 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
<Version>2.0.0-beta1</Version>
<AssemblyName>Senparc.CO2NET.Cache.CsRedis</AssemblyName>
<RootNamespace>Senparc.CO2NET.Cache.CsRedis</RootNamespace>
<GeneratePackageOnBuild Condition=" '$(Configuration)' == 'Release' ">true</GeneratePackageOnBuild>
<Description>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
<Version>2.0.1-beta1</Version>
<AssemblyName>Senparc.CO2NET.Cache.CsRedis</AssemblyName>
<RootNamespace>Senparc.CO2NET.Cache.CsRedis</RootNamespace>
<GeneratePackageOnBuild Condition=" '$(Configuration)' == 'Release' ">true</GeneratePackageOnBuild>
<Description>
CONET cache strategy - Redis module

CO2NET open source project:
https://github.com/Senparc/Senparc.CO2NET
</Description>
<Copyright>Senparc Copyright © 2004~2024</Copyright>
<PackageTags>Senparc.CO2NET,Cache,Redis,CO2NET,盛派</PackageTags>
<Authors>Jeffrey Su</Authors>
<Owners>Senparc</Owners>
<PackageLicenseUrl>https://github.com/JeffreySu/WeiXinMPSDK/blob/master/license.md</PackageLicenseUrl>
<ProjectUrl>https://github.com/JeffreySu/WeiXinMPSDK</ProjectUrl>
<Title>Senparc.CO2NET.Cache.CsRedis.dll</Title>
<Summary>CsRedis Cache for CO2NET C#</Summary>
<PackageProjectUrl>https://github.com/JeffreySu/WeiXinMPSDK</PackageProjectUrl>
<PackageIcon>icon.jpg</PackageIcon>
<PackageReleaseNotes>
<Copyright>Senparc Copyright © 2004~2024</Copyright>
<PackageTags>Senparc.CO2NET,Cache,Redis,CO2NET,盛派</PackageTags>
<Authors>Jeffrey Su</Authors>
<Owners>Senparc</Owners>
<PackageLicenseUrl>https://github.com/JeffreySu/WeiXinMPSDK/blob/master/license.md</PackageLicenseUrl>
<ProjectUrl>https://github.com/JeffreySu/WeiXinMPSDK</ProjectUrl>
<Title>Senparc.CO2NET.Cache.CsRedis.dll</Title>
<Summary>CsRedis Cache for CO2NET C#</Summary>
<PackageProjectUrl>https://github.com/JeffreySu/WeiXinMPSDK</PackageProjectUrl>
<PackageIcon>icon.jpg</PackageIcon>
<PackageReleaseNotes>
v0.1.0 Genesis
v0.5.2 BaseRedisObjectCacheStrategy destructor performs null value check and adds "#{Cache_Redis_Configuration}#" filter check
v1.1.4 RedisObjectCacheStrategy and RedisHashSetObjectCacheStrategy.Get() methods add pure string check
v1.2.5 Fix bug where GetAllByPrefixAsync(key) method automatically retrieves all keys
[2024-09-11] v1.2.6 Update Cache, remove InsertToCache(), add Count(prefix)
[2024-10-24] v2.0.1-beta1 fix: GetCountAsync(string prefix) #306 Thanks to @rendyu
</PackageReleaseNotes>
<RepositoryUrl>https://github.com/Senparc/Senparc.CO2NET</RepositoryUrl>
<Configurations>Debug;Release;Test</Configurations>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<OutputPath>..\BuildOutPut</OutputPath>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>..\..\BuildOutPut</OutputPath>
<DefineConstants>$(DefineConstants);RELEASE</DefineConstants>
<DocumentationFile>..\BuildOutPut\Senparc.CO2NET.Cache.CsRedis.XML</DocumentationFile>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net462|AnyCPU'">
<OutputPath>..\BuildOutPut\</OutputPath>
<DocumentationFile>..\BuildOutPut\net462\Senparc.CO2NET.Cache.CsRedis.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netstandard2.0|AnyCPU'">
<OutputPath>..\BuildOutPut\</OutputPath>
<DocumentationFile>..\BuildOutPut\netstandard2.0\Senparc.CO2NET.Cache.CsRedis.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<None Include="..\Senparc.CO2NET\icon.jpg" Pack="true" Visible="false" PackagePath="" />
</ItemGroup>
<ItemGroup>
<Compile Remove="packages\**" />
<Compile Remove="ServiceStack.Redis\**" />
<EmbeddedResource Remove="packages\**" />
<EmbeddedResource Remove="ServiceStack.Redis\**" />
<None Remove="packages\**" />
<None Remove="ServiceStack.Redis\**" />
</ItemGroup>
<ItemGroup>
<!--<PackageReference Include="Senparc.CO2NET.Cache.Redis.RedLock" Version="0.1.0" />-->
<PackageReference Include="BinaryFormatter" Version="2.1.4" />
<PackageReference Include="CSRedisCore" Version="3.8.800" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Senparc.CO2NET.Cache.CsRedis.RedLock\redlock-cs\src\Senparc.CO2NET.Cache.CsRedis.RedLock.csproj" />
<ProjectReference Include="..\Senparc.CO2NET\Senparc.CO2NET.csproj" />
</ItemGroup>
<RepositoryUrl>https://github.com/Senparc/Senparc.CO2NET</RepositoryUrl>
<Configurations>Debug;Release;Test</Configurations>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<OutputPath>..\BuildOutPut</OutputPath>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>..\..\BuildOutPut</OutputPath>
<DefineConstants>$(DefineConstants);RELEASE</DefineConstants>
<DocumentationFile>..\BuildOutPut\Senparc.CO2NET.Cache.CsRedis.XML</DocumentationFile>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net462|AnyCPU'">
<OutputPath>..\BuildOutPut\</OutputPath>
<DocumentationFile>..\BuildOutPut\net462\Senparc.CO2NET.Cache.CsRedis.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netstandard2.0|AnyCPU'">
<OutputPath>..\BuildOutPut\</OutputPath>
<DocumentationFile>..\BuildOutPut\netstandard2.0\Senparc.CO2NET.Cache.CsRedis.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<None Include="..\Senparc.CO2NET\icon.jpg" Pack="true" Visible="false" PackagePath="" />
</ItemGroup>
<ItemGroup>
<Compile Remove="packages\**" />
<Compile Remove="ServiceStack.Redis\**" />
<EmbeddedResource Remove="packages\**" />
<EmbeddedResource Remove="ServiceStack.Redis\**" />
<None Remove="packages\**" />
<None Remove="ServiceStack.Redis\**" />
</ItemGroup>
<ItemGroup>
<!--<PackageReference Include="Senparc.CO2NET.Cache.Redis.RedLock" Version="0.1.0" />-->
<PackageReference Include="BinaryFormatter" Version="2.1.4" />
<PackageReference Include="CSRedisCore" Version="3.8.800" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Senparc.CO2NET.Cache.CsRedis.RedLock\redlock-cs\src\Senparc.CO2NET.Cache.CsRedis.RedLock.csproj" />
<ProjectReference Include="..\Senparc.CO2NET\Senparc.CO2NET.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ public override Task<long> GetCountAsync()
}
public override Task<long> GetCountAsync(string prefix)
{
return Task.Factory.StartNew(() => GetCount(""));
return Task.Factory.StartNew(() => GetCount(prefix));
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ public override Task<long> GetCountAsync()
}
public override Task<long> GetCountAsync(string prefix)
{
return Task.Factory.StartNew(() => GetCount(""));
return Task.Factory.StartNew(() => GetCount(prefix));
}

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

0 comments on commit b3ac5eb

Please sign in to comment.