`Microsoft.AspNetCore.Mvc.ControllerBase.Created()` returns a `StatusCodes.Status204NoContent` not `StatusCodes.Status201Created`
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 281
Description
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Describe the bug
There seems to be a discrepency in the docs regarding this issue. By observing the attached photo, the `ControllerBase.Created()` returns a `StatusCodes.Status204NoContent`.
Navigating to the documentation at the header of this function (_set the cursor on the function call and click `F12`_), it clearly states it returns a `StatusCodes.Status201Created`
### Expected Behavior
`ControllerBase.Created()` is expected to return what the docs adverise.
### Steps To Reproduce
[Here](https://github.com/3baaady07/TestCreatedReturnStatusCode.git) is a link to the github repository that demonstrates this issue. The repro project is the default ASP.NET Web API project scuffolded by VS2022 with controllers. The only difference is the `Test` endpoint added to `WeatherForecastController` controller as shown in the attached photo.
### Exceptions (if any)
_No response_
### .NET Version
8.0.202
### Anything else?
* ASP.NET 8.0.3
Contributor guide
Assessment
This issue has not been assessed yet.