PlumX.Core.Common 1.0.0-preview.7

This is a prerelease version of PlumX.Core.Common.
dotnet add package PlumX.Core.Common --version 1.0.0-preview.7
                    
NuGet\Install-Package PlumX.Core.Common -Version 1.0.0-preview.7
                    
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="PlumX.Core.Common" Version="1.0.0-preview.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PlumX.Core.Common" Version="1.0.0-preview.7" />
                    
Directory.Packages.props
<PackageReference Include="PlumX.Core.Common" />
                    
Project file
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 PlumX.Core.Common --version 1.0.0-preview.7
                    
#r "nuget: PlumX.Core.Common, 1.0.0-preview.7"
                    
#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 PlumX.Core.Common@1.0.0-preview.7
                    
#: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=PlumX.Core.Common&version=1.0.0-preview.7&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=PlumX.Core.Common&version=1.0.0-preview.7&prerelease
                    
Install as a Cake Tool

PlumX.Core.Common

NuGet 包 ID:PlumX.Core.Common

定位

PlumX.Core.Common 是框架的无业务基础库,提供配置静态访问、通用结果 DTO、异常、参数校验、表达式映射、JWT 校验、HTTP/加密/时间/雪花 ID 等工具。它不引用其他 PlumX.Core 项目,是大多数基础模块的底层依赖。

目标框架与依赖

  • 目标框架:net8.0
  • 项目引用:无
  • 主要依赖:Microsoft.Extensions.Configuration/DI/Options、Newtonsoft.Json、AutoMapper、JWT、Snowflake.Core、PinYinConverterCore

接入方式

业务项目直接引用项目或 NuGet 包即可使用公共类型。AddPlumCore 会设置兼容桥接 AppConfig.Configuration;独立使用 Common 时应优先通过构造函数注入 IConfiguration/服务,避免依赖全局状态。

主要 API

  • AppConfig.Get<T>()Get<T>(key)GetSection(name):读取当前配置。
  • ResultEntityResultEntity<T>:统一成功状态、消息、错误码、数据和数量。
  • TipsException:表示可以直接向调用方展示的业务提示异常。
  • Checker:参数、范围、日期、文件和目录校验。
  • ExpressionMapperMapper<TSource,TTarget>:表达式映射和对象复制。
  • JwtValidatorsHttpUtilEncryptUtilSnowflakeIdUtilPinyinUtil:通用基础工具。

配置

Common 不定义独立配置节。使用 AppConfig 时,应用必须在启动早期提供有效的 IConfiguration;测试应在用例结束时清理全局配置。

边界与运维说明

Common 不包含业务请求上下文、认证中心业务模型或具体数据库实现。全局 AppConfig 会增加多 Host/并行测试的隔离成本;新增公共 API 时应优先提供可注入的实例接口,并保持现有兼容入口可用。

完整使用示例

结果对象和业务异常的最小使用方式见 模块使用示例

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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 was computed.  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.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on PlumX.Core.Common:

Package Downloads
PlumX.Core.Platform

Package Description

PlumX.Core.DomainBase

Package Description

PlumX.Core.CAP

Package Description

PlumX.Core.Caching

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-preview.7 97 9/2/2026
1.0.0-preview.6 91 9/1/2026
1.0.0-preview.5 92 8/31/2026
1.0.0-preview.4 134 8/19/2026
1.0.0-preview.3 124 8/18/2026
1.0.0-preview.2 73 8/17/2026
1.0.0-preview.1 114 8/14/2026