Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Program.cs example for minimal-apis documentation #24361

Merged
merged 1 commit into from
Dec 17, 2021
Merged

Update Program.cs example for minimal-apis documentation #24361

merged 1 commit into from
Dec 17, 2021

Conversation

Huntk23
Copy link
Contributor

@Huntk23 Huntk23 commented Dec 17, 2021

Utilize Microsoft.AspNetCore.Http.StatusCodes instead of integers for Produces() method of a endpoint mapping to utilize available convention within the AspNetCore framework.

Fixes #24360

Utilize Microsoft.AspNetCore.Http.StatusCodes instead of integers for Produces() method of a endpoint mapping to utilize available convention within the AspNetCore framework.
@Huntk23 Huntk23 changed the title Update Program.cs example Update Program.cs example for minimal-apis documentation Dec 17, 2021
@Rick-Anderson
Copy link
Contributor

@Huntk23 did you test the project compiles? Does it need an include?

@Huntk23
Copy link
Contributor Author

Huntk23 commented Dec 17, 2021

Thankfully, no includes are needed. When I tested, the StatusCodes- they fall under Microsoft.AspNetCore.App > Microsoft.AspNetCore.Http which are included in using a .NET 6.0+ project SDK of Microsoft.NET.Sdk.Web (this also includes the new minimal-API WEB API template packed with .NET 6.0+)

Confirmed that cp2do.csproj is correctly up-to-date so we don't need any includes/usings.

Edit: To further clarify; yes, Program.cs compiles

@Rick-Anderson Rick-Anderson merged commit 849e293 into dotnet:main Dec 17, 2021
@Rick-Anderson
Copy link
Contributor

Much appreciated. Nice improvement.
Be sure to check out your name as a contributor about the 3rd of next month on the What's new page in the Community contributors section at the bottom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Utilize Microsoft.AspNetCore.Http.StatusCodes instead of Integers for RouteHandler Produces
2 participants