ApiConventions.CommunityToolkit 6.4.0

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

ApiConventions.CommunityToolKit社区工具包

ApiConventions.CommunityToolKit API社区工具包

  1. 帮助您规范编写API;
  2. 简化API返回类型声明;
  3. 统一返回结果封装;
  4. 参数校验;
  5. 自定义异常捕捉;

发行版本说明

版本 内容
1.0.0 新增约定
1.0.1 增加结果过滤器、参数校验过滤器、异常捕捉过滤器
1.0.2 增加Swagger文档注释过滤器

Definition

Namespace: ApiConventions.CommunityToolKit Assembly: ApiConventions.CommunityToolKit.dll

Examples

  • 代码
using ApiConventions.CommunityToolKit.Extends;

var builder = WebApplication.CreateBuilder(args);

// Add services to the container.

builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();

builder.Services.AddSwaggerGenCommunityToolKitFilter(builder);

builder.Services.AddResponseResultCommunityToolKitFilter();

var app = builder.Build();

// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
    app.UseSwagger();
    app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json",
        $"{builder.Environment.ApplicationName} v1"));
}

app.UseHttpsRedirection();

app.UseAuthorization();

app.MapControllers();

app.Run();


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 was computed.  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 was computed.  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
6.4.4 405 10/19/2022
6.4.3 272 10/12/2022
6.4.2 268 10/12/2022
6.4.1 284 10/12/2022
6.4.0 297 10/12/2022
1.0.0 304 10/8/2022