Crping.Common.Base
2.1.0
dotnet add package Crping.Common.Base --version 2.1.0
NuGet\Install-Package Crping.Common.Base -Version 2.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Crping.Common.Base" Version="2.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Crping.Common.Base" Version="2.1.0" />
<PackageReference Include="Crping.Common.Base" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Crping.Common.Base --version 2.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Crping.Common.Base, 2.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Crping.Common.Base@2.1.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Crping.Common.Base&version=2.1.0
#tool nuget:?package=Crping.Common.Base&version=2.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Crping.Common.Base
常用开发工具包,扩展方法等
版本更新说明
2.1.0
2026年7月31日 星期五
此版本包含破坏性变更(Breaking Changes),升级后需同步修改调用代码。
命名规范化(Breaking Changes)
- 方法重命名:
ToPropertyString→ToPropsString
代码优化
- 字符串比较优化:使用
StringComparison.CurrentCultureIgnoreCase替代.ToLower()比较 - 补全
ModelExt方法的 XML<param>文档标签 - 统一文件作用域命名空间格式
2.0.0
2026年7月31日 星期五
此版本包含破坏性变更(Breaking Changes),升级后需同步修改调用代码。
命名规范化(Breaking Changes)
- 类名重命名:
Clean→StringCleaner,Matching→StringMatching,Conversion→StringConversion - 类名重命名:
ILogger→IConsoleLogger(避免与Microsoft.Extensions.Logging.ILogger冲突) - 类名重命名:
Output→ConsoleOutput,Message→ConsoleMessage,OutputConfig→ConsoleOutputConfig - 方法重命名:
MySubString→SubStringHalfWidth,MyReplace→ReplaceBetweenTags - 方法重命名:
ClearAllBlankToOne→CollapseWhitespace,ToSemiangle→ToHalfWidth - 方法重命名:
ClearJson→EscapeForJson,IsContainsChinese→ContainsChinese - 方法重命名:
GetEnumKvps→GetEnumKeyValues - 参数重命名:
FromJson<T>()的showError→throwOnError - 参数重命名:
GetEnumKeyValues/GetEnumItems/GetCascadeItems的isOrder→applyOrder
命名空间规范化
ImageExt命名空间从Crping.Common.Base.ImageKit修正为Crping.Common.ImageKit- 所有文件统一为文件作用域命名空间(file-scoped namespace)
代码优化
ToCustomFormat()提取公共逻辑FormatRelativeTime,消除DateTime与DateTimeOffset重载的代码重复- 清理注释掉的死代码(
ModelExt.SetModel、ModelExt.UpdateTo、DateTimeExt.CustomTimestamp旧版) - 清理空的 XML 文档标签(
<param>、<returns>)
1.30.0
2025年11月27日 星期四
- 新增方法
ToEnumName()
1.29.0
2025年11月10日 星期一
- 新增图片处理类
ImageExt - 新增图片处理方法
ToBytes(...),ToStream(...),ReduceSize(...)
1.28.2
2025年10月24日 星期五
- 方法:
FromJson<T>(...)的委托参数改为Action<Exception, string>
1.28.1
2025年10月24日 星期五
- 移除方法:
FromJson<T>(...)的委托参数的默认值
1.28.0
2025年10月24日 星期五
- 新增带委托参数的方法:
FromJson<T>(...)
1.27.0
2025年10月21日 星期二
- 新增实体类
CascadeItem - 新增方法
GetCascadeItems(...),将枚举成员列表转换为级联选择数据列表 - 优化方法
GetEnumItems(...)
1.26.1
2025年7月12日 星期六
- 优化方法
ToCustomFormat()
1.26.0
2025年4月9日 星期三
- 新增方法:
ToStringId(...),将对象转换为字符串ID - 优化方法:
CustomTimestamp(...)
1.25.2
2025年4月9日 星期三
- 优化方法
ToCustomFormat()
1.25.1
2024年6月14日 星期五
GetEnumKvps(Type enumType, bool isOrder = false),修复未设置相关属性时的异常GetEnumItems<TEnum>(bool isOrder = false),修复未设置相关属性时的异常
1.25.0
2024年6月14日 星期五
GetEnumKvps(Type enumType, bool isOrder = false),新增排序功能GetEnumItems<TEnum>(bool isOrder = false),新增排序功能
1.24.0
2024年3月28日 星期四
- 新增方法:
CustomTimestamp(...) - 修改方法:
GenerateId(...),GetTimestampStr(...),新增参数:fixedTime - 修改实体类:
TreeNode
1.23.0
2024年3月20日 星期三
GenerateId(...)与GetTimestampStr(...)方法新增参数,并优化处理逻辑- 升级引用组件
1.22.0
2024年3月13日 星期三
- 新增方法:
GenerateId(...)
1.21.0
2023年10月26日 星期四
EnumKit新增方法List<(string Name, TEnum Code, int Value)> GetEnumItems<TEnum> ()EnumKit新增方法string GetEnumName<TEnum> (TEnum enumValue)
1.20.0
2023-05-29
- 方法
IsContainsChinese()新增参数isAllChinese
1.19.0
2023-05-29
- 新增方法:
IsContainsChinese(),判断字符串是否包含中文
1.18.0
2023-02-17
- 新增以时间戳生成的62 或 36 进制的字符串方法
GetTimestampStr
1.17.0
2023-02-15
- 新增字符串按分隔符转数组方法
SplitBySymbols
1.16.1
2023-02-12
- 方法
GetPropsMapping添加匿名类型输出
1.16.0
2023-02-12
ModelExt新增方法GetPropsMapping
1.15.0
2023-02-03
- 将运行环境修改为
net7.0 - 根据新运行环境支持的新语法优化代码
1.14.0
2023-01-04
- 新增日期时间的个性化格式方法:
ToCustomFormat ToLabelValues中使用ToCustomFormat输出日期时间数据
1.13.2
2023-01-03
- 方法
ToLabelValues添加对日期时间的格式处理
1.13.1
2023-01-03
ModelKit中的方法ToLabelValues新增属性排序功能
1.13.0
2022-12-31
ModelKit添加新方法ToString
1.12.0
2022-12-30
- 新增方法:ToLabelValues,将对象的属性与值转换成 Label Value 键值对列表
1.11.0
2022-10-20
- 添加Xml文档输出
- 优化字符串处理相关类
- 升级引用组件:System.Text.Json
1.10.0
2022-10-18
- 新增:方法
Truncation,截取字符串
1.9.0
2022-08-03
- 添加:ILogger,Logger
2022-04-20
- 修复数字时间戳转DateTime不正确的Bug
2022-03-17
- 添加方法:GetPropsAndValues,获取由对象的属性与值拼接的字符串,支持包含和排除部分属性。
2021-07-22
- 添加DateTimeKit,调整代码位置
- GetTimeStamp添加转大写参数,仅数字参数,随机数参数
以往更新记录
- 1.8.1:更新System.Text.Json版本
- 1.8.0:修复数字时间戳转DateTime不正确的Bug
- 1.7.1:Matching部分方法添加非空检测
- 1.7.0:新增方法:GetPropsAndValues,获取由对象的属性与值拼接的字符串,支持包含和排除部分属性。
- 1.6.0:新增方法:GetAllFiles,递归获取目录及其所有子目录中的指定类型文件
- 1.5.0:新增Truncate,UnicodeToNative,ToSemiangle方法,将RemoveBracketsAndContents重命令名为ClearBracketsAndContents
- 1.4.0:新增方法:GetSubstringByWord、RemoveBracketsAndContents
- 1.3.0:新增Cascade,TreeNode实体
- 1.2.0:添加时间相关方法
- 1.1.1:优化时间戳相关方法
- 1.1.0:优化GetTimeStamp,优化一些类名
- 1.0.1:添加时间戳转换,GetTimeStamp添加转大写参数,随机数参数,仅数字参数
- 1.0.0:常用开发工具包,扩展方法等
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- SixLabors.ImageSharp (>= 3.1.12)
- System.ComponentModel.Annotations (>= 5.0.0)
-
net7.0
- SixLabors.ImageSharp (>= 3.1.12)
- System.Text.Json (>= 10.0.10)
NuGet packages (7)
Showing the top 5 NuGet packages that depend on Crping.Common.Base:
| Package | Downloads |
|---|---|
|
Crping.Common
常用方法工具包 |
|
|
Crping.Auth.BLL
Crping.Auth 的业务逻辑层 |
|
|
Crping.Multitasking
Crping.Multitasking |
|
|
Crping.WeixinPay
微信支付 |
|
|
Crping.AuthPolicy.BLL
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.1.0 | 40 | 7/31/2026 |
| 2.0.0 | 37 | 7/31/2026 |
| 1.30.0 | 382 | 11/27/2025 |
| 1.29.0 | 309 | 11/10/2025 |
| 1.28.2 | 260 | 10/24/2025 |
| 1.28.1 | 245 | 10/24/2025 |
| 1.28.0 | 257 | 10/24/2025 |
| 1.27.0 | 264 | 10/21/2025 |
| 1.26.1 | 240 | 7/12/2025 |
| 1.26.0 | 408 | 4/9/2025 |
| 1.25.2 | 314 | 4/9/2025 |
| 1.25.1 | 594 | 6/14/2024 |
| 1.25.0 | 261 | 6/14/2024 |
| 1.24.0 | 464 | 3/28/2024 |
| 1.23.0 | 312 | 3/20/2024 |
| 1.22.0 | 288 | 3/13/2024 |
| 1.21.0 | 424 | 10/26/2023 |
| 1.20.0 | 600 | 5/29/2023 |
| 1.19.0 | 303 | 5/29/2023 |
| 1.18.0 | 668 | 2/17/2023 |
Loading failed
常用基础方法