To modify or add the View location folder, we created a class, which inherited the IViewLocationExpander interface. If we did not add the following code, we would not have to include the native Views folder location; we would replace it:
foreach(string location in viewLocations){ yield return location;}
The two native folders where the MVC mechanism would search for Views are:
"/Views/{ControllerName}" "/Views/Shared"
Now, with the following code, we will add the new Views locations:
yield return "/ViewsOld/Shared/{0}.cshtml";yield return "/ViewsOld/{1}/{0}.cshtml";
We could get the same result without using the OldViewsExpander class by just adding the following code to the ConfigureServices method:
services.Configure<RazorViewEngineOptions>(options ...