Restrict display of section link to ASP.NET Core 2.2 or later (#16733)

pull/16744/head
Scott Addie 2020-01-27 12:57:32 -06:00 committed by GitHub
parent a78cfd4b09
commit 0eb07a10e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 1 deletions

View File

@ -5,7 +5,7 @@ description: Learn the basics of creating a web API in ASP.NET Core.
monikerRange: '>= aspnetcore-2.1'
ms.author: scaddie
ms.custom: mvc
ms.date: 11/22/2019
ms.date: 01/27/2020
uid: web-api/index
---
# Create web APIs with ASP.NET Core
@ -72,14 +72,29 @@ For a list that includes the available attributes, see the <xref:Microsoft.AspNe
The [`[ApiController]`](xref:Microsoft.AspNetCore.Mvc.ApiControllerAttribute) attribute can be applied to a controller class to enable the following opinionated, API-specific behaviors:
::: moniker range=">= aspnetcore-2.2"
* [Attribute routing requirement](#attribute-routing-requirement)
* [Automatic HTTP 400 responses](#automatic-http-400-responses)
* [Binding source parameter inference](#binding-source-parameter-inference)
* [Multipart/form-data request inference](#multipartform-data-request-inference)
* [Problem details for error status codes](#problem-details-for-error-status-codes)
The *Problem details for error status codes* feature requires a [compatibility version](xref:mvc/compatibility-version) of 2.2 or later. The other features require a compatibility version of 2.1 or later.
::: moniker-end
::: moniker range="= aspnetcore-2.1"
* [Attribute routing requirement](#attribute-routing-requirement)
* [Automatic HTTP 400 responses](#automatic-http-400-responses)
* [Binding source parameter inference](#binding-source-parameter-inference)
* [Multipart/form-data request inference](#multipartform-data-request-inference)
These features require a [compatibility version](xref:mvc/compatibility-version) of 2.1 or later.
::: moniker-end
### Attribute on specific controllers
The `[ApiController]` attribute can be applied to specific controllers, as in the following example from the project template: