ApiConventions.CommunityToolkit
1.0.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package ApiConventions.CommunityToolkit --version 1.0.0
NuGet\Install-Package ApiConventions.CommunityToolkit -Version 1.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="ApiConventions.CommunityToolkit" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ApiConventions.CommunityToolkit --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ApiConventions.CommunityToolkit, 1.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.
// Install ApiConventions.CommunityToolkit as a Cake Addin #addin nuget:?package=ApiConventions.CommunityToolkit&version=1.0.0 // Install ApiConventions.CommunityToolkit as a Cake Tool #tool nuget:?package=ApiConventions.CommunityToolkit&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ApiConventions.CommunityToolKit社区工具包
ApiConventions.CommunityToolKit API社区工具包
- 帮助您规范编写API;
- 简化API返回类型声明;
- 统一返回结果封装;
- 参数校验;
- 自定义异常捕捉;
发行版本说明
版本 | 内容 |
---|---|
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 | Versions 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- log4net (>= 2.0.15)
- Microsoft.AspNet.WebApi.Core (>= 5.2.8)
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 6.0.9)
- Microsoft.AspNetCore.Mvc.Core (>= 2.2.5)
- Microsoft.AspNetCore.Mvc.WebApiCompatShim (>= 2.2.0)
- Microsoft.Extensions.DependencyInjection (>= 7.0.0-preview.6.22324.4)
- Newtonsoft.Json (>= 12.0.2)
- NSwag.ApiDescription.Client (>= 13.0.5)
- Swashbuckle.AspNetCore (>= 6.3.2)
- System.IdentityModel.Tokens.Jwt (>= 6.23.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.