[AI-Suggested] Content update request from UUF signal: Part 2, add a controller to an ASP.NET Core MVC app | Microsoft Learn
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 70/100
- Tipo di issue
- Documentazione
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- csharp
- Ambito
- documentation
Direzione di ricerca
Modifica aspnetcore/tutorials/first-mvc-app/adding-controller.md, il file sorgente indicato nell’issue. Inizia verificando i passaggi di scaffolding di Visual Studio e l’esempio HelloWorldController.cs in base al comportamento attuale di Visual Studio e alle istruzioni circostanti del tutorial. Aggiorna il punto di ingresso e la nota per la risoluzione dei problemi, poi rendi coerenti l’esempio del controller e la relativa spiegazione. Il lavoro è completato quando entrambi gli aggiornamenti richiesti sono chiari e il blocco di codice compila così come è scritto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Documentation Update: Part 2, add a controller to an ASP.NET Core MVC app | Microsoft Learn
Customer Feedback
Page: Part 2, add a controller to an ASP.NET Core MVC app | Microsoft Learn
Source File: https://github.com/dotnet/AspNetCore.Docs/blob/live/aspnetcore/tutorials/first-mvc-app/adding-controller.md
Summary
Update the “Add a controller” instructions to match current Visual Studio UI/scaffolding entry points and refresh the sample controller code to reflect the default scaffolded action signatures (IActionResult) or explicitly explain why the tutorial uses string returns.
Suggested Fixes
Instructions for Copilot: Copilot should only fix suggestions with a checkmark and do not make any updates for unchecked suggestions.
[!NOTE]
Suggestions are generated by AI and they should be reviewed by human before assigning it to Copilot. Please uncheck the ones you don't want Copilot to work on. Then assign this issue to Agent (GitHub Copilot). When assigning it to Copilot you can enter additional instructions under "Optional Prompt" dialog.
-
In the “Add a controller” (Visual Studio) subsection, update the UI/scaffolding steps to reflect current Visual Studio behavior and add a short troubleshooting note for users who don’t see “Add New Scaffolded Item”. Concretely: (1) verify and update the exact menu path/screenshots for the latest VS (e.g., right-click Controllers > Add > Controller… and/or Add > New Scaffolded Item… depending on version); (2) add a callout listing prerequisites that make scaffolding appear (ASP.NET and web development workload installed; correct project type/template; optional: individual components like scaffolding tools). Include an explicit “If you don’t see it” paragraph under the existing screenshot.
Example add-on text (place immediately after the ‘right-click Controllers > Add > Controller’ step):
If you don’t see Controller… or Add New Scaffolded Item, confirm you installed the ASP.NET and web development workload in Visual Studio Installer. Also ensure you’re in an ASP.NET Core Web App (Model-View-Controller) project (not Minimal API/Empty). In some Visual Studio versions, the entry point appears as Add > New Scaffolded Item… instead of Add > Controller…. -
Update the HelloWorldController code in the “Replace the contents of Controllers/HelloWorldController.cs” block (and the paragraph that says “both methods return a string”) to align with the controller/action signature users get from modern templates (commonly
IActionResultorActionResult<string>). Either (A) change the sample to useIActionResult+Content()so it matches scaffolded output, or (B) keepstringbut add a clear note explaining that this tutorial intentionally usesstringfor simplicity and that scaffolding may generateIActionResultby default. Provide one canonical code block that compiles as-is.Example replacement code (recommended, matches IActionResult):
using Microsoft.AspNetCore.Mvc; using System.Text.Encodings.Web; namespace MvcMovie.Controllers; public class HelloWorldController : Controller { // GET: /HelloWorld/ public IActionResult Index() { return Content("This is my default action..."); } // GET: /HelloWorld/Welcome/ public IActionResult Welcome() { return Content("This is the Welcome action method..."); } }And update the explanatory sentence to: “In the sample above, both methods return an
IActionResultusingContent()to produce a plain-text response.”
📚 To learn more about agentic content maintenance workflow, visit Agentic workflow for Learn content maintenance. Sign in using Learn Profile to access the content on this link.
💬 Share your feedback on the Learn Content Maintenance Agentic Workflow here.
- Lingua principale
- C#
- Stelle
- 13.1k
- Fork
- 24.5k
- Merge medio
- 3g 2h
- PR unite (30g)
- 210
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di dotnet/AspNetCore.Docs
-
aspnet-core/svc doc-enhancement mvc/subsvc Pri2
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
dotnet/AspNetCore.Docs#38016 ·
I maintainer di solito rispondono entro 1 giorno
-
aspnet-core/svc doc-enhancement hosting-deployment/subsvc Pri2 Source - Docs.ms
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
dotnet/AspNetCore.Docs#38009 ·
I maintainer di solito rispondono entro 1 giorno
-
:watch: Not Triaged CAC
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
dotnet/AspNetCore.Docs#38000 ·
I maintainer di solito rispondono entro 1 giorno
-
:watch: Not Triaged CAC
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
dotnet/AspNetCore.Docs#37998 ·
I maintainer di solito rispondono entro 1 giorno
-
[AI-Suggested] Content update request from UUF signal: Build a Blazor movie database app (Part 1 - Create a Blazor Web App) | Microsoft LearnForse già presa @guardrex l’ha presa 8 giorni fa. Aperta:watch: Not Triaged CAC
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
dotnet/AspNetCore.Docs#37995 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di dotnet/AspNetCore.Docs
Issue simili
-
VB -> C#
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
icsharpcode/CodeConverter#1301 ·
I maintainer di solito rispondono entro 3 giorni
-
PettingZoo wrappers send only the first action component to every action dimensionForse già presa @RaphaelFakhri l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
Unity-Technologies/ml-agents#6341 ·
I maintainer di solito rispondono entro 1 giorno
-
Area: World-Readiness
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
microsoft/calculator#2522 ·
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
Sonarr/Sonarr#9274 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
mailto support for hyperlinkApertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100