EasilyNET.WebCore 1.9.0-preview1

This is a prerelease version of EasilyNET.WebCore.
There is a newer version of this package available.
See the version list below for details.
dotnet add package EasilyNET.WebCore --version 1.9.0-preview1
                    
NuGet\Install-Package EasilyNET.WebCore -Version 1.9.0-preview1
                    
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="1.9.0-preview1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EasilyNET.WebCore" Version="1.9.0-preview1" />
                    
Directory.Packages.props
<PackageReference Include="EasilyNET.WebCore" />
                    
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 EasilyNET.WebCore --version 1.9.0-preview1
                    
#r "nuget: EasilyNET.WebCore, 1.9.0-preview1"
                    
#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@1.9.0-preview1
                    
#: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=1.9.0-preview1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=EasilyNET.WebCore&version=1.9.0-preview1&prerelease
                    
Install as a Cake Tool

EasilyNET.WebCore

一些.Net 6+ 的 WebApi 常用中间件和一些 Filter,以及部分数据类型到 Json 的转换

EasilyNET.WebCore Filter 使用?

目前支持异常处理和返回数据格式化

  • 使用 Nuget 安装 EasilyNET.WebCore

  • 然后在 Program.cs 中添加如下内容

  • Net 6 +

// Add services to the container.
builder.Services.AddControllers(c =>
{
    c.Filters.Add<ExceptionFilter>(); // 异常处理Filter
    c.Filters.Add<ActionExecuteFilter>(); // 返回数据格式化Filter
});

EasilyNET.WebCore JsonConverter 使用?

  • 该库目前补充的 Converter 有: DateTimeConverter, DateTimeNullConverter, TimeSpanJsonConverter, TimeOnly, DateOnly

  • 其中 TimeOnly 和 DateOnly 仅支持.Net6+ API 内部使用,传入和传出 Json 仅支持固定格式字符串

  • 如: DateOnly👉"2021-11-11", TimeOnly👉"23:59:25"

  • 使用 Nuget 安装 EasilyNET.WebCore

  • 然后在上述 Program.cs 中添加如下内容

  • .Net 6 +

// Add services to the container.
builder.Services.AddControllers(c =>
{
    c.Filters.Add<ExceptionFilter>(); // 异常处理Filter
    c.Filters.Add<ActionExecuteFilter>(); // 返回数据格式化Filter
}).AddJsonOptions(c =>
{
    c.JsonSerializerOptions.Converters.Add(new SystemTextJsonConvert.DateTimeConverter());
    c.JsonSerializerOptions.Converters.Add(new SystemTextJsonConvert.DateTimeNullConverter());
});

EasilyNET.WebCore 中间件使用?

目前支持全局 API 执行时间中间件

  • 新增限流中间件(防抖),用于避免短时间内,重复请求

  • 使用 Nuget 安装 # EasilyNET.WebCore

  • 然后在 Program.cs 中添加如下内容

  • .Net 6 +

// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment()) app.UseDeveloperExceptionPage();

app.UseHoyoResponseTime(); // 全局Action执行时间
...
app.Run();

.Net 6 中使用 3 种库的方法集合

  • Program.cs 文件
var builder = WebApplication.CreateBuilder(args);

// Add services to the container.
builder.Services.AddControllers(c =>
{
    c.Filters.Add<ExceptionFilter>(); // 异常处理Filter
    c.Filters.Add<ActionExecuteFilter>(); // 返回数据格式化Filter
}).AddJsonOptions(c =>
{
    c.JsonSerializerOptions.Converters.Add(new SystemTextJsonConvert.DateTimeConverter());
    c.JsonSerializerOptions.Converters.Add(new SystemTextJsonConvert.DateTimeNullConverter());
});
...

var app = builder.Build();

// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment()) app.UseDeveloperExceptionPage();

app.UseHoyoResponseTime();
...
  • API 响应结果示例
{
  "statusCode": 200,
  "msg": "success",
  "data": [
    {
      "date": "2021-10-10 17:38:16",
      "temperatureC": 6,
      "temperatureF": 42,
      "summary": "Freezing"
    },
    {
      "date": "2021-10-11 17:38:16",
      "temperatureC": 18,
      "temperatureF": 64,
      "summary": "Warm"
    }
  ]
}
  • Response headers
hoyo-response-time: 5 ms
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 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 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

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
4.25.921.71 60 9/20/2025
4.25.919.15 242 9/18/2025
4.25.918.142 236 9/18/2025
4.25.918.115 234 9/18/2025
4.25.918.30 248 9/17/2025
4.25.917.141 255 9/17/2025
4.25.917.134 257 9/17/2025
4.25.911.151 131 9/11/2025
4.25.905.150 121 9/5/2025
4.25.820.100 137 8/20/2025
4.25.814.175 135 8/14/2025
4.25.731.155 111 7/31/2025
4.25.724.1 538 7/23/2025
4.25.720.80 241 7/20/2025
4.25.716.42 146 7/15/2025
4.25.617.153 157 6/17/2025
4.25.616.190 147 6/16/2025
4.25.616.182 142 6/16/2025
4.25.613.111 287 6/13/2025
4.25.609.190 265 6/9/2025
3.24.1125.181 121 11/25/2024
3.24.1125.104 128 11/25/2024
3.24.1121.183 123 11/21/2024
3.24.1120.183 126 11/20/2024
3.24.1119.31 125 11/18/2024
3.24.1115.143 123 11/15/2024
3.24.1113.100 137 11/13/2024
3.24.1112.125 129 11/12/2024
3.24.1107.140 129 11/7/2024
3.24.1107.54 126 11/7/2024
3.24.1107.34 123 11/7/2024
3.24.1105.111 133 11/5/2024
3.24.1103.31 142 11/2/2024
3.24.1103 148 11/2/2024
3.24.1031.135 140 10/31/2024
3.24.1031.112 133 10/31/2024
3.24.1031.104 132 10/31/2024
3.24.1029.142 144 10/29/2024
3.24.1025.30 138 10/24/2024
3.24.1022.142 129 10/22/2024
3.24.1018.204 192 10/18/2024
3.24.1018.175 179 10/18/2024
3.24.1018.166 174 10/18/2024
3.24.1018.93 198 10/18/2024
3.24.1017.42 139 10/16/2024
3.24.1016.161 136 10/16/2024
3.24.1015.231 136 10/15/2024
3.24.1015.14 151 10/14/2024
3.24.1012.114 140 10/12/2024
3.24.1009.115 138 10/9/2024
3.24.1008.160 133 10/8/2024
3.24.1008.133 136 10/8/2024
3.24.1007.185 140 10/7/2024
3.24.1003.33 146 10/2/2024
3.24.1002.162 137 10/2/2024
3.24.929.143 139 9/29/2024
3.24.929.141 147 9/29/2024
3.24.929.131 129 9/29/2024
3.24.929.122 139 9/29/2024
3.24.926.184 149 9/26/2024
3.24.926.182 137 9/26/2024
3.24.926.175 150 9/26/2024
3.24.924.160 137 9/24/2024
3.24.924.133 151 9/24/2024
3.24.924.124 141 9/24/2024
3.24.924.10 138 9/23/2024
3.24.924.1 138 9/23/2024
3.24.923.234 146 9/23/2024
3.24.923.232 136 9/23/2024
3.24.923.155 139 9/23/2024
3.24.919.92 147 9/19/2024
3.24.914.125 138 9/14/2024
3.24.914.115 141 9/14/2024
3.24.914.111 140 9/14/2024
3.24.911.95 171 9/11/2024
3.24.908.215 148 9/8/2024
3.24.904.200 150 9/4/2024
3.24.828.163 147 8/28/2024
3.24.820.173 151 8/20/2024
3.24.814.92 160 8/14/2024
3.24.812.115 173 8/12/2024
3.24.802.100 146 8/2/2024
3.24.801.162 139 8/1/2024
3.24.801.160 140 8/1/2024
3.24.730.164 124 7/30/2024
3.24.730.91 135 7/30/2024
3.24.724.91 138 7/24/2024
3.24.718.105 163 7/18/2024
3.24.716.95 149 7/16/2024
3.24.712.94 148 7/12/2024
3.24.710.14 159 7/9/2024
3.24.709.105 179 7/9/2024
3.24.704.94 164 7/4/2024
3.24.701.90 162 7/1/2024
3.24.628.114 185 6/28/2024
3.24.627.145 154 6/27/2024
3.24.620.160 165 6/20/2024
3.24.613.115 152 6/13/2024
3.24.612.95 150 6/12/2024
3.24.528.90 148 5/28/2024
3.24.522.84 167 5/22/2024
3.24.512.213 145 5/12/2024
3.24.508.112 171 5/8/2024
2.2024.428.71 163 4/28/2024
2.2024.427.1128 152 4/27/2024
2.2.72 168 4/14/2024
2.2.71 155 4/12/2024
2.2.8 162 4/26/2024
2.2.6 159 4/10/2024
2.2.5 183 3/26/2024
2.2.4 166 3/25/2024
2.2.3 168 3/24/2024
2.2.2 195 3/21/2024
2.2.1 183 3/20/2024
2.2.0 173 3/13/2024
2.1.9 193 2/21/2024
2.1.8 175 2/18/2024
2.1.7 161 2/16/2024
2.1.6 178 2/14/2024
2.1.5 156 2/14/2024
2.1.4 217 2/9/2024
2.1.3 206 2/8/2024
2.1.2 198 2/5/2024
2.1.1.2 277 12/26/2023
2.1.1.1 179 12/26/2023
2.1.1 214 12/25/2023
2.1.0 221 12/17/2023
2.0.11 262 12/6/2023
2.0.1 246 11/15/2023
2.0.0 182 11/14/2023
1.9.1 193 11/1/2023
1.9.0 193 10/19/2023
1.9.0-preview2 387 10/12/2023
1.9.0-preview1 164 10/12/2023
1.8.9 252 10/11/2023
1.8.8 207 10/11/2023
1.8.7-rc2 169 9/21/2023
1.8.7-rc1 182 9/12/2023
1.8.6 252 8/31/2023
1.8.5 940 8/25/2023
1.8.4 254 8/24/2023
1.8.3 241 8/23/2023
1.8.2 309 8/22/2023
1.8.1 270 8/18/2023
1.8.0 273 8/15/2023
1.7.9 288 8/11/2023
1.7.8 218 8/11/2023
1.7.7 259 8/10/2023
1.7.6 269 8/9/2023
1.7.5 300 8/9/2023
1.7.4 357 8/3/2023
1.7.3 265 8/1/2023
1.7.2 240 7/31/2023
1.7.1 239 7/27/2023
1.7.0 253 7/25/2023
1.6.9 265 7/25/2023
1.6.8 261 7/24/2023
1.6.7 277 7/20/2023
1.6.6 262 7/19/2023
1.6.5 255 7/19/2023
1.6.4 262 7/17/2023
1.6.3 222 7/17/2023
1.6.2 324 7/12/2023
1.6.1 315 6/30/2023
1.6.0 231 6/26/2023
1.5.9 258 6/22/2023
1.5.8 287 6/15/2023
1.5.7.1 270 6/14/2023
1.5.7 273 6/14/2023
1.5.6.2 319 6/7/2023
1.5.6.1 276 6/7/2023
1.5.6 258 6/7/2023
1.5.5.2 307 5/26/2023
1.5.5.1 291 5/26/2023
1.5.5 284 5/26/2023
1.5.4.4 258 5/25/2023
1.5.4.3 293 5/23/2023
1.5.4.2 379 5/17/2023
1.5.4.1 272 5/16/2023
1.5.4 362 5/11/2023
1.5.3 267 5/11/2023
1.5.2 288 5/10/2023
1.5.1 286 5/10/2023
1.5.0 337 5/6/2023
1.4.0 301 5/5/2023
1.3.9 351 4/23/2023
1.3.8.6 260 4/23/2023
1.3.8.5 261 4/21/2023
1.3.8.1 332 4/12/2023
1.3.8 267 4/11/2023
1.3.7 290 4/9/2023
1.3.6.3 370 4/1/2023
1.3.6.2 296 3/31/2023
1.3.6.1 300 3/31/2023
1.3.6 248 3/31/2023
1.3.5 262 3/30/2023
1.3.4.1 347 3/29/2023
1.3.4 293 3/28/2023
1.3.3 269 3/28/2023
1.3.2 299 3/26/2023
1.3.1 369 3/22/2023
1.3.0 298 3/21/2023
1.2.0 301 3/21/2023
1.1.0 306 3/17/2023
1.0.9 318 3/15/2023
1.0.8 318 3/15/2023
1.0.7 294 3/15/2023
1.0.6 306 3/13/2023
1.0.5 312 3/13/2023
1.0.4 288 3/13/2023
1.0.1 402 2/23/2023
1.0.0 334 2/20/2023