dotnet / AspNetCore.Docs

Documentation for ASP.NET Core
https://docs.microsoft.com/aspnet/core
Creative Commons Attribution 4.0 International
12.62k stars 25.3k forks source link

explicit uri examples help to inform a beginner like me how the different parameter types differ in the "url" request #33862

Open xela-trawets opened 1 week ago

xela-trawets commented 1 week ago

Description

The code examples do not have comments with text that one can see how the parameters sit in the url, for example "http://localhost:5000/hello/JackDaniels" to match an example like app.MapGet("/hello/{name}", (FromRoute string? name) => {return Results.Ok(...);});

the *.http file type might be a good way to make this clear, curl is a little bit gray-beard

Its easy to not know the relavant syntax of question marks, quotes and equals signs..

Page URL

https://learn.microsoft.com/en-us/aspnet/core/fundamentals/minimal-apis/parameter-binding?view=aspnetcore-8.0

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/fundamentals/minimal-apis/parameter-binding.md

Document ID

a09dcf06-a685-e5b8-0ce4-a4e53c57a9fd

Article author

@Rick-Anderson

Related Issues

wadepickett commented 1 week ago

@xela-trawets, thanks for taking the time to provide your suggestion. I agree that an example for each one would be very helpful and an improvement.

xela-trawets commented 1 week ago

I feel I should offer a pr here, since I brought it up.. Once I get time..