55f0638c56
Fixes https://github.com/aspnet/Docs/issues/9298 **Summary of Changes** * Display the "Problem details" section for 2.2+ only * Restore the missing `Startup.ConfigureServices` code snippets * Genericize the compat flag language * Use the `ConfigureApiBehaviorOptions` method for the 2.2 doc * Add content for `[assembly: ApiController]` in the 2.2 doc * Expand upon default response type returned for 400 status codes * Added a solution file for the sample app to improve usability * A quick UE pass **Internal Review Pages** * [2.2](https://review.docs.microsoft.com/en-us/aspnet/core/web-api/?branch=pr-en-us-9303&view=aspnetcore-2.2#problem-details-responses-for-error-status-codes) * [2.1](https://review.docs.microsoft.com/en-us/aspnet/core/web-api/?branch=pr-en-us-9303&view=aspnetcore-2.1#problem-details-responses-for-error-status-codes) * [2.0](https://review.docs.microsoft.com/en-us/aspnet/core/web-api/?branch=pr-en-us-9303&view=aspnetcore-2.0#problem-details-responses-for-error-status-codes) |
||
---|---|---|
.. | ||
WebApiSample.Api.21 | ||
WebApiSample.Api.22 | ||
WebApiSample.Api.Pre21 | ||
WebApiSample.DataAccess | ||
README.md | ||
WebApiSample.sln |
README.md
ASP.NET Core Web API Controller Sample
This sample app consists of the following projects:
- *WebApiSample.Api.22: An ASP.NET Core 2.2 project targeting .NET Core 2.2.
- WebApiSample.Api.21: An ASP.NET Core 2.1 project targeting .NET Core 2.1.
- WebApiSample.Api.Pre21: An ASP.NET Core 2.0 project targeting .NET Core 2.0.
- WebApiSample.DataAccess: A .NET Standard 2.0 class library serving as a data access tier for the 2 Web API projects.
This sample illustrates variations of Web API controller creation: