Skip to content

Commit 994ad6c

Browse files
Use NuGet package for routing info (#17546)
* Use NuGet package for routing info * Use NuGet package for routing info * Use NuGet package for routing info
1 parent a790ce3 commit 994ad6c

7 files changed

Lines changed: 23 additions & 57 deletions

File tree

aspnetcore/mvc/controllers/areas.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Areas in ASP.NET Core
33
author: rick-anderson
44
description: Learn how Areas are an ASP.NET MVC feature used to organize related functionality into a group as a separate namespace (for routing) and folder structure (for views).
55
ms.author: riande
6-
ms.date: 12/05/2019
6+
ms.date: 03/21/2019
77
uid: mvc/controllers/areas
88
---
99
# Areas in ASP.NET Core

aspnetcore/mvc/controllers/areas/31samples/MVCareas/Areas/Products/Controllers/HomeController.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Microsoft.AspNetCore.Mvc;
2+
using Microsoft.Docs.Samples;
23

34
namespace MVCareas.Areas.Products.Controllers
45
{
@@ -7,13 +8,13 @@ public class HomeController : Controller
78
{
89
public IActionResult Index()
910
{
10-
ViewData["routeInfo"] = ControllerContext.ToCtxString();
11+
ViewData["routeInfo"] = ControllerContext.MyDisplayRouteInfo();
1112
return View();
1213
}
1314

1415
public IActionResult About()
1516
{
16-
ViewData["routeInfo"] = ControllerContext.ToCtxString();
17+
ViewData["routeInfo"] = ControllerContext.MyDisplayRouteInfo();
1718
return View();
1819
}
1920
}

aspnetcore/mvc/controllers/areas/31samples/MVCareas/Areas/Products/Controllers/ManageController.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#region snippet
22
using Microsoft.AspNetCore.Mvc;
3+
using Microsoft.Docs.Samples;
34

45
namespace MVCareas.Areas.Products.Controllers
56
{
@@ -10,13 +11,13 @@ public class ManageController : Controller
1011
#endregion
1112
public IActionResult Index()
1213
{
13-
ViewData["routeInfo"] = ControllerContext.ToCtxString();
14+
ViewData["routeInfo"] = ControllerContext.MyDisplayRouteInfo();
1415
return View();
1516
}
1617

1718
public IActionResult About()
1819
{
19-
ViewData["routeInfo"] = ControllerContext.ToCtxString();
20+
ViewData["routeInfo"] = ControllerContext.MyDisplayRouteInfo();
2021
return View();
2122
}
2223
}

aspnetcore/mvc/controllers/areas/31samples/MVCareas/Areas/Services/Controllers/HomeController.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Microsoft.AspNetCore.Mvc;
2+
using Microsoft.Docs.Samples;
23

34
namespace MVCareas.Areas.Services.Controllers
45
{
@@ -8,13 +9,13 @@ public class HomeController : Controller
89
{
910
public IActionResult Index()
1011
{
11-
ViewData["routeInfo"] = ControllerContext.ToCtxString();
12+
ViewData["routeInfo"] = ControllerContext.MyDisplayRouteInfo();
1213
return View();
1314
}
1415

1516
public IActionResult About()
1617
{
17-
ViewData["routeInfo"] = ControllerContext.ToCtxString();
18+
ViewData["routeInfo"] = ControllerContext.MyDisplayRouteInfo();
1819
return View();
1920
}
2021
}

aspnetcore/mvc/controllers/areas/31samples/MVCareas/Controllers/HomeController.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
using Microsoft.AspNetCore.Mvc;
22
using MVCareas.Models;
33
using System.Diagnostics;
4+
using Microsoft.Docs.Samples;
45

56
namespace MVCareas.Controllers
67
{
78
public class HomeController : Controller
89
{
910
public IActionResult Index()
1011
{
11-
ViewData["routeInfo"] = ControllerContext.ToCtxString();
12+
ViewData["routeInfo"] = ControllerContext.MyDisplayRouteInfo();
1213
return View();
1314
}
1415

1516
public IActionResult Privacy()
1617
{
17-
ViewData["routeInfo"] = ControllerContext.ToCtxString();
18+
ViewData["routeInfo"] = ControllerContext.MyDisplayRouteInfo();
1819
return View();
1920
}
2021

2122
public IActionResult About()
2223
{
23-
ViewData["routeInfo"] = ControllerContext.ToCtxString();
24+
ViewData["routeInfo"] = ControllerContext.MyDisplayRouteInfo();
2425
return View();
2526
}
2627

aspnetcore/mvc/controllers/areas/31samples/MVCareas/Extensions/ControllerContextExtensions.cs

Lines changed: 0 additions & 46 deletions
This file was deleted.
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.1</TargetFramework>
55
</PropertyGroup>
66

7+
<ItemGroup>
8+
<Folder Include="Extensions\" />
9+
</ItemGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="Rick.Docs.Samples.RouteInfo" Version="1.0.*" />
13+
</ItemGroup>
14+
715
</Project>

0 commit comments

Comments
 (0)