Skip to content

Commit fa4c1e7

Browse files
Use NuGet routing debug package (#17572)
* Use NuGet routing debug package * Use NuGet routing debug package * Use NuGet routing debug package * Use NuGet routing debug package
1 parent 994ad6c commit fa4c1e7

27 files changed

Lines changed: 37 additions & 79 deletions

aspnetcore/fundamentals/routing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Discover how ASP.NET Core routing is responsible for matching HTTP
55
monikerRange: '>= aspnetcore-2.1'
66
ms.author: riande
77
ms.custom: mvc
8-
ms.date: 3/25/2020
8+
ms.date: 4/1/2020
99
uid: fundamentals/routing
1010
---
1111
# Routing in ASP.NET Core
@@ -574,7 +574,7 @@ The preceding constraint is applied in the following code:
574574

575575
[!code-csharp[](routing/samples/3.x/RoutingSample/Controllers/TestController.cs?name=snippet&highlight=6,13)]
576576

577-
The [MyDisplayRouteInfo](https://github.com/dotnet/AspNetCore.Docs/tree/master/aspnetcore/fundamentals/routing/samples/3.x/RoutingSample/Extensions/ControllerContextExtensions.cs) method is included in the [sample download](https://github.com/dotnet/AspNetCore.Docs/tree/master/aspnetcore/fundamentals/routing/samples/3.x) and is used to display routing information.
577+
[!INCLUDE[](~/includes/MyDisplayRouteInfo.md)]
578578

579579
The implementation of `MyCustomConstraint` prevents `0` being applied to a route parameter:
580580

aspnetcore/fundamentals/routing/samples/3.x/RoutingSample/Controllers/GadgetController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using Microsoft.AspNetCore.Mvc;
2-
2+
using Microsoft.Docs.Samples;
33

44
namespace RoutingSample.Controllers
55
{

aspnetcore/fundamentals/routing/samples/3.x/RoutingSample/Controllers/HomeController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using Microsoft.AspNetCore.Mvc;
2-
2+
using Microsoft.Docs.Samples;
33

44
namespace RoutingSample.Controllers
55
{

aspnetcore/fundamentals/routing/samples/3.x/RoutingSample/Controllers/ProductController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Microsoft.AspNetCore.Mvc;
22
using Microsoft.AspNetCore.Routing;
3-
3+
using Microsoft.Docs.Samples;
44

55
namespace RoutingSample.Controllers
66
{

aspnetcore/fundamentals/routing/samples/3.x/RoutingSample/Controllers/TestController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Microsoft.AspNetCore.Http;
22
using Microsoft.AspNetCore.Mvc;
3-
3+
using Microsoft.Docs.Samples;
44

55
namespace RoutingSample.Controllers
66
{

aspnetcore/fundamentals/routing/samples/3.x/RoutingSample/Controllers/WidgetController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Microsoft.AspNetCore.Mvc;
22
using Microsoft.AspNetCore.Routing;
3-
3+
using Microsoft.Docs.Samples;
44

55
namespace RoutingSample.Controllers
66
{

aspnetcore/fundamentals/routing/samples/3.x/RoutingSample/Extensions/ControllerContextExtensions.cs

Lines changed: 0 additions & 31 deletions
This file was deleted.

aspnetcore/fundamentals/routing/samples/3.x/RoutingSample/RoutingSample.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<ItemGroup>
88
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="3.1.0" />
99
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.1" />
10+
<PackageReference Include="Rick.Docs.Samples.RouteInfo" Version="1.0.0*" />
1011
</ItemGroup>
11-
12+
1213
</Project>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[MyDisplayRouteInfo](https://github.com/Rick-Anderson/RouteInfo/blob/master/Microsoft.Docs.Samples.RouteInfo/ControllerContextExtensions.cs) is provided by the [Rick.Docs.Samples.RouteInfo](https://www.nuget.org/packages/Rick.Docs.Samples.RouteInfo) NuGet package and displays route information.

aspnetcore/mvc/controllers/routing.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,17 @@ The route template `"{controller=Home}/{action=Index}/{id?}"`:
4545
* Matches a URL path like `/Products/Details/5`
4646
* Extracts the route values `{ controller = Products, action = Details, id = 5 }` by tokenizing the path. The extraction of route values results in a match if the app has a controller named `ProductsController` and a `Details` action:
4747

48-
[!code-csharp[](routing/samples/3.x/main/Controllers/ProductsController.cs?name=snippetA)]
48+
[!code-csharp[](routing/samples/3.x/main/Controllers/ProductsController.cs?name=snippetA)]
4949

50-
The [MyDisplayRouteInfo](https://github.com/dotnet/AspNetCore.Docs/tree/master/aspnetcore/mvc/controllers/routing/samples/3.x/main/Extensions/ControllerContextExtensions.cs) method is included in the [sample download](https://github.com/dotnet/AspNetCore.Docs/tree/master/aspnetcore/mvc/controllers/routing/samples/3.x) and is used to display routing information.
50+
[!INCLUDE[](~/includes/MyDisplayRouteInfo.md)]
5151

52-
* `/Products/Details/5` model binds the value of `id = 5` to set the `id` parameter to `5`. See [Model Binding](xref:mvc/models/model-binding) for more details.
52+
* `/Products/Details/5` model binds the value of `id = 5` to set the `id` parameter to `5`. See [Model Binding](xref:mvc/models/model-binding) for more details.
5353
* `{controller=Home}` defines `Home` as the default `controller`.
5454
* `{action=Index}` defines `Index` as the default `action`.
5555
* The `?` character in `{id?}` defines `id` as optional.
5656
* Default and optional route parameters don't need to be present in the URL path for a match. See [Route Template Reference](xref:fundamentals/routing#route-template-reference) for a detailed description of route template syntax.
5757
* Matches the URL path `/`.
5858
* Produces the route values `{ controller = Home, action = Index }`.
59-
* The [MyDisplayRouteInfo](https://github.com/dotnet/AspNetCore.Docs/tree/master/aspnetcore/mvc/controllers/routing/samples/3.x/main/Extensions/ControllerContextExtensions.cs) method is included in the [sample download](https://github.com/dotnet/AspNetCore.Docs/tree/master/aspnetcore/mvc/controllers/routing/samples/3.x) and is used to display routing information.
6059

6160
The values for `controller` and `action` make use of the default values. `id` doesn't produce a value since there's no corresponding segment in the URL path. `/` only matches if there exists a `HomeController` and `Index` action:
6261

0 commit comments

Comments
 (0)