Xinghe.Utility.Extensions 1.0.85

dotnet add package Xinghe.Utility.Extensions --version 1.0.85
                    
NuGet\Install-Package Xinghe.Utility.Extensions -Version 1.0.85
                    
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="Xinghe.Utility.Extensions" Version="1.0.85" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Xinghe.Utility.Extensions" Version="1.0.85" />
                    
Directory.Packages.props
<PackageReference Include="Xinghe.Utility.Extensions" />
                    
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 Xinghe.Utility.Extensions --version 1.0.85
                    
#r "nuget: Xinghe.Utility.Extensions, 1.0.85"
                    
#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 Xinghe.Utility.Extensions@1.0.85
                    
#: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=Xinghe.Utility.Extensions&version=1.0.85
                    
Install as a Cake Addin
#tool nuget:?package=Xinghe.Utility.Extensions&version=1.0.85
                    
Install as a Cake Tool

Xinghe.Utility.Extensions

基于杏和框架(Xinghe.Utility / H.Utility / H.BASE)的 .NET 6 扩展类库,用于辅助项目开发。提供工具扩展方法、HTTP 模块客户端、依赖注入、声明式事务、认证上下文等能力。

安装

dotnet add package Xinghe.Utility.Extensions

功能概览

  • 工具扩展(Utilities):字符串、日期、集合、字典、JSON、枚举、Mapster 映射、Base64、实体审计字段、对象去空格、IFormFile 等静态扩展方法。
  • HTTP 基础设施 + 模块客户端:基于 RestSharp 的统一执行/日志/计时封装,及调用杏和各业务模块(H07/S01/S28/H0413/H5702 等)的客户端,统一返回 XhResponse<T>
  • 服务封装(Services)XhBaseDataService(基础数据)、XhTokenService(Token)、XhMaxService(表最大值生成)。
  • 依赖注入[AppService] 标记 + Autofac RegisterAppServices 自动扫描注册(可挂拦截器)。
  • 声明式事务[Transactional(ContextType = typeof(...))],基于 SqlSugar UoW,自动开/提交/回滚。
  • 安全与寻址AuthContextProvider(从 HttpContext 取登录态)、SoftModuleUrlResolver(模块地址解析)。
  • 通用模型与校验XhResponse<T> 响应包络、NotBlank/NotEmptyCollection/InValues 校验特性。

快速开始

// 启动装配(Program.cs)
builder.AddXingheUtilityExtensions();
app.UseXingheUtilityExtensions();

// 标记服务自动注册
[AppService]
public class MyService { }

// 扩展方法
var dto = entity.CopyTo<MyDto>();
var json = obj.ToJsonString();
DateTime monthStart = DateTime.Now.StartOfMonth();

// 声明式事务
[Transactional(ContextType = typeof(DBContext_Master))]
public async Task SaveAsync() { ... }

文档

完整 API 清单见包内 content/Xinghe.Utility.Extensions.Api.md(安装后会复制到引用方项目根目录)。

License

MIT

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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 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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.85 40 6/25/2026
1.0.84 44 6/25/2026
1.0.83 81 6/23/2026
1.0.82 165 6/9/2026
1.0.81 128 6/9/2026
1.0.80 147 6/8/2026
1.0.79 140 6/4/2026
1.0.78 141 5/30/2026
1.0.77 148 5/25/2026
1.0.76 147 5/25/2026
1.0.75 138 5/20/2026
1.0.74 124 5/19/2026
1.0.72 141 5/19/2026
1.0.71 158 5/19/2026
1.0.70 159 5/16/2026
1.0.69 162 5/11/2026
1.0.68 173 5/11/2026
1.0.67 159 5/9/2026
1.0.66 159 5/9/2026
1.0.6 143 5/25/2026
Loading failed