EasilyNET.WebCore
6.26.201.257
dotnet add package EasilyNET.WebCore --version 6.26.201.257
NuGet\Install-Package EasilyNET.WebCore -Version 6.26.201.257
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="EasilyNET.WebCore" Version="6.26.201.257" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EasilyNET.WebCore" Version="6.26.201.257" />
<PackageReference Include="EasilyNET.WebCore" />
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 EasilyNET.WebCore --version 6.26.201.257
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EasilyNET.WebCore, 6.26.201.257"
#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 EasilyNET.WebCore@6.26.201.257
#: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=EasilyNET.WebCore&version=6.26.201.257
#tool nuget:?package=EasilyNET.WebCore&version=6.26.201.257
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
EasilyNET.WebCore
面向 .NET 6+ 的 WebAPI 组件集合:中间件、异常处理与 JSON 转换器。
功能概览
- JSON 转换器:DateTime/DateOnly/TimeOnly/Decimal/Int/Bool
- 异常处理:
BusinessExceptionHandler(基于 .NET 8IExceptionHandler) - 中间件:
UseResponseTime()输出X-Response-Time - WebSocket 服务端:高性能会话与处理器模型
JSON Converter 使用
当前提供的 Converter:
DateTimeJsonConverter(格式:yyyy-MM-dd HH:mm:ss)DateOnlyJsonConverter(格式:yyyy-MM-dd)TimeOnlyJsonConverter(格式:HH:mm:ss)DecimalJsonConverter(读数值/字符串,写出为字符串)IntJsonConverter(读数值/字符串,写出为数值)BoolJsonConverter(读 true/false/"true"/"false"/数值)
using EasilyNET.WebCore.JsonConverters;
builder.Services.AddControllers().AddJsonOptions(c =>
{
c.JsonSerializerOptions.Converters.Add(new DateTimeJsonConverter());
c.JsonSerializerOptions.Converters.Add(new DateOnlyJsonConverter());
c.JsonSerializerOptions.Converters.Add(new TimeOnlyJsonConverter());
c.JsonSerializerOptions.Converters.Add(new DecimalJsonConverter());
c.JsonSerializerOptions.Converters.Add(new IntJsonConverter());
c.JsonSerializerOptions.Converters.Add(new BoolJsonConverter());
});
业务异常处理(.NET 8+)
BusinessExceptionHandler 仅处理 BusinessException,并输出 ProblemDetails。
using EasilyNET.WebCore.Handlers;
builder.Services.AddExceptionHandler<BusinessExceptionHandler>();
var app = builder.Build();
app.UseExceptionHandler();
中间件
Response Time
在响应头添加 X-Response-Time,建议尽量靠前放置:
app.UseResponseTime();
WebSocket Server
高性能 WebSocket 服务端支持:
快速接入:
using EasilyNET.WebCore.WebSocket;
builder.Services.AddSingleton<ChatHandler>();
var app = builder.Build();
app.UseWebSockets();
app.MapWebSocketHandler<ChatHandler>("/ws");
| Product | Versions 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 is compatible. 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
- EasilyNET.Core (>= 6.26.201.257)
-
net8.0
- EasilyNET.Core (>= 6.26.201.257)
-
net9.0
- EasilyNET.Core (>= 6.26.201.257)
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 |
|---|---|---|
| 6.26.201.257 | 34 | 1/31/2026 |
| 6.26.114.102 | 89 | 1/14/2026 |
| 6.26.107.173 | 90 | 1/7/2026 |
| 5.25.1212.131 | 135 | 12/12/2025 |
| 5.25.1112.15 | 290 | 11/11/2025 |
| 4.25.1016.112 | 404 | 10/16/2025 |