Skip to content

Commit 3c8a75b

Browse files
Update routing.md (#19997)
tiny correction
1 parent 6feb3ea commit 3c8a75b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

aspnetcore/mvc/controllers/routing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ Consider the following controller:
337337
In the preceding code:
338338

339339
* Each action contains the `[HttpGet]` attribute, which constrains matching to HTTP GET requests only.
340-
* The `GetProduct` action includes the `"{id}"` template, therefore `id` is appended to the `"api/[controller]"` template on the controller. The methods template is `"api/[controller]/"{id}""`. Therefore this action only matches GET requests of for the form `/api/test2/xyz`,`/api/test2/123`,`/api/test2/{any string}`, etc.
340+
* The `GetProduct` action includes the `"{id}"` template, therefore `id` is appended to the `"api/[controller]"` template on the controller. The methods template is `"api/[controller]/"{id}""`. Therefore this action only matches GET requests for the form `/api/test2/xyz`,`/api/test2/123`,`/api/test2/{any string}`, etc.
341341
[!code-csharp[](routing/samples/3.x/main/Controllers/Test2Controller.cs?name=snippet2)]
342342
* The `GetIntProduct` action contains the `"int/{id:int}")` template. The `:int` portion of the template constrains the `id` route values to strings that can be converted to an integer. A GET request to `/api/test2/int/abc`:
343343
* Doesn't match this action.

0 commit comments

Comments
 (0)