How to do it...

  1. First, let's create a new views folder named ViewsOld. In this folder, we will copy _ViewImports.cshtml and _ViewSart/cshtml from the Views folder, and cut the Product views folder to paste it into the ViewsOld folder:
  1. Next, we create a folder named Infrastructure and create a C# class named OldViewsExpander.cs. This class will contain the following code:
public class OldViewsExpander : IViewLocationExpander{  public IEnumerable<string> ExpandViewLocations  (ViewLocationExpanderContext context,  IEnumerable<string> viewLocations)  {    // rerturn all classic locations    foreach (string location in viewLocations)    { yield return location; ...

Get ASP.NET Core MVC 2.0 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.