Closed ajhanson22227 closed 2 months ago
@ajhanson22227, thanks for the suggestion and letting us know your experience with the topic. I will queue this up to look at it for improvement.
Verified return for PostTodoItem is using nameof(GetTodoItem)
in current update.
Description
https://learn.microsoft.com/en-us/aspnet/core/tutorials/first-web-api?view=aspnetcore-8.0&tabs=visual-studio-code#update-the-posttodoitem-create-method
In the code sample it replaces the hard-coded "PostTodoItem" action name using nameof; however, when created following this guide, it is generated with "GetTodoItem" instead and should probably use that in the example page. Using the GetTodoItem action returns the correct url path to get the record while using PostTodoItem action returns the id in a query string, and using that url as a GET request will call the GetAll action
Page URL
https://learn.microsoft.com/en-us/aspnet/core/tutorials/first-web-api?view=aspnetcore-8.0&tabs=visual-studio
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/tutorials/first-web-api.md
Document ID
95f2549e-29f9-e31a-b4d0-432b971643ff
Article author
@wadepickett
Associated WorkItem - 272935