Description
This article and app sample is out of date.
Update to use:
- .NET 10 (the current sample is .NET 9),
- Visual Studio 2026,
- Latest VS Code
- Minimal API with ASP.NET Core
- MongoDB 8.0 (8.0.20 which is latest stable supported utnil 10/2029)
The current version uses controllers. It should be changed to Minimal API iwth ASP.NET Core going forward:
For example:
Tell readers to uncheck "Use controllers" in the VS dialog, or remove --use-controllers from the CLI command, the template will then scaffold Program.cs without controller support already wired up
"Replace the Add a controller" section
This entire section gets replaced with instructions to add the Map* route handlers directly in Program.cs instead of creating a BooksController class
"Configure JSON serialization options" section
The instruction to chain .AddJsonOptions(...) onto AddControllers() would need to be rewritten, since AddControllers() itself goes away
Page URL
https://learn.microsoft.com/en-us/aspnet/core/tutorials/first-mongo-app?view=aspnetcore-10.0&tabs=visual-studio
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/tutorials/first-mongo-app.md
Document ID
83a5cb3b-23bc-4f0c-cd1c-1d1ffeb1131a
Platform Id
65f2481a-2462-7f68-0aa8-570bd4557d09
Article author
@wadepickett
Metadata
- ID: 5240866d-d0a1-f0dd-7b2c-203e1d69bc4b
- PlatformId: 65f2481a-2462-7f68-0aa8-570bd4557d09
- Service: aspnet-core
- Sub-service: tutorials
Related Issues
Description
This article and app sample is out of date.
Update to use:
The current version uses controllers. It should be changed to Minimal API iwth ASP.NET Core going forward:
For example:
Tell readers to uncheck "Use controllers" in the VS dialog, or remove --use-controllers from the CLI command, the template will then scaffold Program.cs without controller support already wired up
"Replace the Add a controller" section
This entire section gets replaced with instructions to add the Map* route handlers directly in Program.cs instead of creating a BooksController class
"Configure JSON serialization options" section
The instruction to chain .AddJsonOptions(...) onto AddControllers() would need to be rewritten, since AddControllers() itself goes away
Page URL
https://learn.microsoft.com/en-us/aspnet/core/tutorials/first-mongo-app?view=aspnetcore-10.0&tabs=visual-studio
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/tutorials/first-mongo-app.md
Document ID
83a5cb3b-23bc-4f0c-cd1c-1d1ffeb1131a
Platform Id
65f2481a-2462-7f68-0aa8-570bd4557d09
Article author
@wadepickett
Metadata
Related Issues