EasilyNET.WebCore 1.8.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package EasilyNET.WebCore --version 1.8.0                
NuGet\Install-Package EasilyNET.WebCore -Version 1.8.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="EasilyNET.WebCore" Version="1.8.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EasilyNET.WebCore --version 1.8.0                
#r "nuget: EasilyNET.WebCore, 1.8.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.
// Install EasilyNET.WebCore as a Cake Addin
#addin nuget:?package=EasilyNET.WebCore&version=1.8.0

// Install EasilyNET.WebCore as a Cake Tool
#tool nuget:?package=EasilyNET.WebCore&version=1.8.0                

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. 
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.109.111 1 a day ago
4.25.108.182 19 2 days ago
4.25.108.160 24 2 days ago
4.25.1.1 82 9 days ago
3.24.1224.141 75 17 days ago
3.24.1216.116 89 25 days ago
3.24.1206.100 91 a month ago
3.24.1205.171 93 a month ago
3.24.1202.150 91 a month ago
3.24.1126.231 82 a month ago
3.24.1126.172 86 a month ago
3.24.1126.114 82 2 months ago
3.24.1126.104 90 2 months ago
3.24.1125.181 79 2 months ago
3.24.1125.104 88 2 months ago
3.24.1121.183 85 2 months ago
3.24.1120.183 83 2 months ago
3.24.1119.31 88 2 months ago
3.24.1115.143 81 2 months ago
3.24.1113.100 91 2 months ago
3.24.1112.125 88 2 months ago
3.24.1107.140 90 2 months ago
3.24.1107.54 86 2 months ago
3.24.1107.34 85 2 months ago
3.24.1105.111 92 2 months ago
3.24.1103.31 97 2 months ago
3.24.1103 110 2 months ago
3.24.1031.135 101 2 months ago
3.24.1031.112 94 2 months ago
3.24.1031.104 93 2 months ago
3.24.1029.142 101 2 months ago
3.24.1025.30 98 3 months ago
3.24.1022.142 85 3 months ago
3.24.1018.204 146 3 months ago
3.24.1018.175 145 3 months ago
3.24.1018.166 139 3 months ago
3.24.1018.93 157 3 months ago
3.24.1017.42 102 3 months ago
3.24.1016.161 97 3 months ago
3.24.1015.231 98 3 months ago
3.24.1015.14 105 3 months ago
3.24.1012.114 102 3 months ago
3.24.1009.115 100 3 months ago
3.24.1008.160 95 3 months ago
3.24.1008.133 96 3 months ago
3.24.1007.185 101 3 months ago
3.24.1003.33 109 3 months ago
3.24.1002.162 98 3 months ago
3.24.929.143 100 3 months ago
3.24.929.141 107 3 months ago
3.24.929.131 92 3 months ago
3.24.929.122 100 3 months ago
3.24.926.184 110 3 months ago
3.24.926.182 98 3 months ago
3.24.926.175 107 3 months ago
3.24.924.160 97 4 months ago
3.24.924.133 114 4 months ago
3.24.924.124 102 4 months ago
3.24.924.10 101 4 months ago
3.24.924.1 102 4 months ago
3.24.923.234 102 4 months ago
3.24.923.232 96 4 months ago
3.24.923.155 101 4 months ago
3.24.919.92 112 4 months ago
3.24.914.125 101 4 months ago
3.24.914.115 106 4 months ago
3.24.914.111 109 4 months ago
3.24.911.95 131 4 months ago
3.24.908.215 113 4 months ago
3.24.904.200 118 4 months ago
3.24.828.163 117 4 months ago
3.24.820.173 118 5 months ago
3.24.814.92 126 5 months ago
3.24.812.115 137 5 months ago
3.24.802.100 106 5 months ago
3.24.801.162 104 5 months ago
3.24.801.160 105 5 months ago
3.24.730.164 87 5 months ago
3.24.730.91 94 5 months ago
3.24.724.91 96 6 months ago
3.24.718.105 127 6 months ago
3.24.716.95 107 6 months ago
3.24.712.94 110 6 months ago
3.24.710.14 121 6 months ago
3.24.709.105 143 6 months ago
3.24.704.94 121 6 months ago
3.24.701.90 120 6 months ago
3.24.628.114 147 6 months ago
3.24.627.145 113 6 months ago
3.24.620.160 130 7 months ago
3.24.613.115 117 7 months ago
3.24.612.95 114 7 months ago
3.24.528.90 114 7 months ago
3.24.522.84 129 8 months ago
3.24.512.213 113 8 months ago
3.24.508.112 136 8 months ago
2.2024.428.71 123 8 months ago
2.2024.427.1128 112 8 months ago
2.2.72 123 9 months ago
2.2.71 117 9 months ago
2.2.8 124 9 months ago
2.2.6 127 9 months ago
2.2.5 148 9 months ago
2.2.4 131 10 months ago
2.2.3 128 10 months ago
2.2.2 153 10 months ago
2.2.1 149 10 months ago
2.2.0 139 10 months ago
2.1.9 155 2/21/2024
2.1.8 133 2/18/2024
2.1.7 130 2/16/2024
2.1.6 142 2/14/2024
2.1.5 122 2/14/2024
2.1.4 187 2/9/2024
2.1.3 174 2/8/2024
2.1.2 164 2/5/2024
2.1.1.2 241 12/26/2023
2.1.1.1 145 12/26/2023
2.1.1 179 12/25/2023
2.1.0 185 12/17/2023
2.0.11 239 12/6/2023
2.0.1 230 11/15/2023
2.0.0 163 11/14/2023
1.9.1 171 11/1/2023
1.9.0 168 10/19/2023
1.9.0-preview2 338 10/12/2023
1.9.0-preview1 139 10/12/2023
1.8.9 228 10/11/2023
1.8.8 178 10/11/2023
1.8.7-rc2 143 9/21/2023
1.8.7-rc1 140 9/12/2023
1.8.6 209 8/31/2023
1.8.5 879 8/25/2023
1.8.4 205 8/24/2023
1.8.3 198 8/23/2023
1.8.2 265 8/22/2023
1.8.1 227 8/18/2023
1.8.0 226 8/15/2023
1.7.9 243 8/11/2023
1.7.8 174 8/11/2023
1.7.7 216 8/10/2023
1.7.6 221 8/9/2023
1.7.5 255 8/9/2023
1.7.4 312 8/3/2023
1.7.3 216 8/1/2023
1.7.2 194 7/31/2023
1.7.1 193 7/27/2023
1.7.0 205 7/25/2023
1.6.9 219 7/25/2023
1.6.8 212 7/24/2023
1.6.7 229 7/20/2023
1.6.6 214 7/19/2023
1.6.5 202 7/19/2023
1.6.4 213 7/17/2023
1.6.3 172 7/17/2023
1.6.2 271 7/12/2023
1.6.1 267 6/30/2023
1.6.0 182 6/26/2023
1.5.9 209 6/22/2023
1.5.8 233 6/15/2023
1.5.7.1 215 6/14/2023
1.5.7 219 6/14/2023
1.5.6.2 260 6/7/2023
1.5.6.1 219 6/7/2023
1.5.6 203 6/7/2023
1.5.5.2 248 5/26/2023
1.5.5.1 236 5/26/2023
1.5.5 228 5/26/2023
1.5.4.4 206 5/25/2023
1.5.4.3 237 5/23/2023
1.5.4.2 319 5/17/2023
1.5.4.1 213 5/16/2023
1.5.4 303 5/11/2023
1.5.3 210 5/11/2023
1.5.2 232 5/10/2023
1.5.1 231 5/10/2023
1.5.0 280 5/6/2023
1.4.0 244 5/5/2023
1.3.9 293 4/23/2023
1.3.8.6 202 4/23/2023
1.3.8.5 203 4/21/2023
1.3.8.1 278 4/12/2023
1.3.8 208 4/11/2023
1.3.7 234 4/9/2023
1.3.6.3 312 4/1/2023
1.3.6.2 237 3/31/2023
1.3.6.1 241 3/31/2023
1.3.6 189 3/31/2023
1.3.5 207 3/30/2023
1.3.4.1 283 3/29/2023
1.3.4 231 3/28/2023
1.3.3 209 3/28/2023
1.3.2 238 3/26/2023
1.3.1 306 3/22/2023
1.3.0 244 3/21/2023
1.2.0 234 3/21/2023
1.1.0 251 3/17/2023
1.0.9 261 3/15/2023
1.0.8 257 3/15/2023
1.0.7 234 3/15/2023
1.0.6 249 3/13/2023
1.0.5 257 3/13/2023
1.0.4 232 3/13/2023
1.0.1 341 2/23/2023
1.0.0 258 2/20/2023