Skip to content

Conversation

@timdeschryver
Copy link
Contributor

@timdeschryver timdeschryver commented Apr 14, 2025

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

📄 File 🔗 Preview link
aspnetcore/tutorials/first-mongo-app.md Create a web API with ASP.NET Core and MongoDB

@timdeschryver timdeschryver changed the title Issue/35180 Add testing options to the mongodb Web Api tutorial 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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Rick-Anderson Rick-Anderson merged commit d73608a into dotnet:main Apr 15, 2025
3 checks passed
@Rick-Anderson
Copy link
Contributor

@timdeschryver thanks! sorry it took so long

@timdeschryver timdeschryver deleted the issue/35180 branch April 16, 2025 06:43
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.

Elaborate on the different testing options

2 participants