Harbour.NETCore.Chloe 8.0.0

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

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 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. 
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
8.0.0 136 3/16/2025
6.4.2 119 11/13/2024
6.4.1 109 11/12/2024
6.4.0 117 11/11/2024
6.3.16 112 5/1/2024
6.3.11 202 8/31/2023
6.3.10 165 7/14/2023
6.3.9 147 7/14/2023
6.3.8 154 7/8/2023
6.3.6 150 7/8/2023
6.3.5 186 6/30/2023
6.3.4 174 6/25/2023
6.3.3 169 6/20/2023
6.3.2 180 5/16/2023
6.3.1 183 5/3/2023