Harbour.AspNetCore
8.0.3
See the version list below for details.
dotnet add package Harbour.AspNetCore --version 8.0.3
NuGet\Install-Package Harbour.AspNetCore -Version 8.0.3
<PackageReference Include="Harbour.AspNetCore" Version="8.0.3" />
<PackageVersion Include="Harbour.AspNetCore" Version="8.0.3" />
<PackageReference Include="Harbour.AspNetCore" />
paket add Harbour.AspNetCore --version 8.0.3
#r "nuget: Harbour.AspNetCore, 8.0.3"
#:package Harbour.AspNetCore@8.0.3
#addin nuget:?package=Harbour.AspNetCore&version=8.0.3
#tool nuget:?package=Harbour.AspNetCore&version=8.0.3
Harbour.NETCoreExtensions
介绍
Harbour.AspNetCore 是将Furion项目最小化拆分,并移除部分特性的AspNetCore6工具集
先注册 .AddNewtonsoftJson() 再注册AddUnifyResult()
2、中间件注册顺序
if (env.IsDevelopment())
app.UseDeveloperExceptionPage();
// 添加规范化结果状态码,需要在这里注册
app.UseUnifyResultStatusCodes();
app.UseStaticFiles();
//启用会话
app.UseSession();
app.UseRouting();
// 跨域
app.UseCorsAccessor();
// vue 路由
app.UseVueRouterHistory();
//启用登陆验证
app.UseAuthentication();
app.UseAuthorization();
// 规范化文档
app.UseSpecificationDocuments();
// FineUI 和 MVC 中间件(确保 UseFineUI 位于 UseMvc 的前面)
app.UseFineUI();
app.UseEndpoints(endpoints =>());
1、UnifyResult:规范化结果
1、使用方式
1、services.AddUnifyResult();
2、实现IValidationMessageTypeProvider可验证消息类型提供器
3、实现IErrorCodeTypeProvider可异常错误代码提供器
2、原理
通过DataValidationFilter过滤器(IActionFilter),拦截验证失败返回结果,实现对响应数据验证的处理 通过IAsyncExceptionFilter过滤器(IAsyncExceptionFilter),拦截抛出异常的返回结果,实现对响应友好异常的处理 通过UnifyResultFilter过滤器(IAsyncActionFilter),实现对响应成功的结果规范化处理
2、UnifyResultStatusCodes:规范化结果状态码
1、使用方式
1、services.AddUnifyResult(); app.UseUnifyResultStatusCodes();
2、原理
通过注册UnifyResultStatusCodesMiddleware中间件,实现对所有Response的拦截并解析StatusCode>=400且StatusCode!=404的响应 并将401、403的状态码改为200,规范化返回内容
更新历史
2024-11-10:同步更新至:2024-11-10 09bf28cefd8cc17168caf18567e15a00b585e253;时间:2024/11/10 13:05:52
2022-10-30:同步更新至:2022-10-30 2b7e0c83e698d37f3c8326d4a177eee4f9ab942c
2022-06-14:同步更新至:2022-06-14 2ebb01c593b21d72dd17a86e6f9860fab9714e01
2022-05-29:同步跟新至:2022-05-25 3b9d39ce691f9505c5541a790103fbb0ba6d35af
| 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 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. |
-
net8.0
- Harbour.NETCore (>= 8.0.3)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Harbour.AspNetCore:
| Package | Downloads |
|---|---|
|
Harbour.AspNetCore.SpecificationDocument
Harbour.AspNetCore |
|
|
Harbour.AspNetCore.JwtBearer
Harbour.AspNetCore |
|
|
Harbour.AspNetCore.NewtonsoftJson
Harbour.AspNetCore |
|
|
Harbour.AspNetCore.Yarp
Harbour.AspNetCore |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 8.1.3 | 410 | 9/13/2025 |
| 8.1.2 | 301 | 9/9/2025 |
| 8.1.1 | 315 | 9/3/2025 |
| 8.1.0 | 268 | 9/2/2025 |
| 8.0.6 | 315 | 8/29/2025 |
| 8.0.5 | 279 | 8/29/2025 |
| 8.0.3 | 318 | 8/27/2025 |
| 8.0.2 | 372 | 8/25/2025 |
| 8.0.1 | 258 | 8/21/2025 |
| 8.0.0 | 329 | 3/16/2025 |
| 6.4.0 | 424 | 11/11/2024 |
| 6.3.16 | 315 | 5/1/2024 |
| 6.3.11 | 1,014 | 8/31/2023 |
| 6.3.10 | 642 | 7/14/2023 |
| 6.3.9 | 542 | 7/14/2023 |
| 6.3.8 | 614 | 7/8/2023 |
| 6.3.6 | 541 | 7/8/2023 |
| 6.3.5 | 448 | 6/30/2023 |
| 6.3.4 | 477 | 6/25/2023 |
| 6.3.3 | 275 | 6/20/2023 |
| 6.3.2 | 297 | 5/16/2023 |
| 6.3.1 | 275 | 5/3/2023 |
| 6.2.1 | 1,169 | 6/18/2022 |
| 6.2.0 | 1,136 | 6/18/2022 |
| 6.1.1 | 1,118 | 6/15/2022 |
| 6.1.0 | 1,136 | 6/15/2022 |
| 6.0.1 | 1,469 | 5/27/2022 |
| 6.0.0 | 1,323 | 5/27/2022 |