Add testing options to the mongodb Web Api tutorial#35221
Merged
Rick-Anderson merged 2 commits intodotnet:mainfrom Apr 15, 2025
Merged
Add testing options to the mongodb Web Api tutorial#35221Rick-Anderson merged 2 commits intodotnet:mainfrom
Rick-Anderson merged 2 commits intodotnet:mainfrom
Conversation
timdeschryver
commented
Apr 14, 2025
| * Contains action methods to support GET, POST, PUT, and DELETE HTTP requests. | ||
| * Calls <xref:Microsoft.AspNetCore.Mvc.ControllerBase.CreatedAtAction%2A> in the `Create` action method to return an [HTTP 201](https://www.rfc-editor.org/rfc/rfc9110#status.201) response. Status code 201 is the standard response for an HTTP POST method that creates a new resource on the server. `CreatedAtAction` also adds a `Location` header to the response. The `Location` header specifies the URI of the newly created book. | ||
|
|
||
| ## Configure JSON serialization options |
Contributor
Author
There was a problem hiding this comment.
I moved this section before the testing section, because the testing section uses the configured JSON serialization options, e.g. bookName is mapped to Name.
c3514f9 to
e5d02c5
Compare
timdeschryver
commented
Apr 14, 2025
Rick-Anderson
approved these changes
Apr 15, 2025
Contributor
|
@timdeschryver thanks! sorry it took so long |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #35180
This splits the testing section into a testing section for VS (using http files) and VS Code (using swagger UI), similar to the tutorial about a Web API.
I've also deleted the unused weatherforecast files in the example.
I didn't include images to get your feedback first.
If you agree on the structure (and steps), I can include some screenshots of the steps.
Internal previews