Let\'s say I have a controller that uses attribute based routing to handle a requested url of /admin/product like so:
I am using core 3.1 and just do this inside of ConfigureServices method inside of Startup.cs.
services.AddControllersWithViews().AddRazorOptions(
options => {// Add custom location to view search location
options.ViewLocationFormats.Add("/Views/Shared/YourLocation/{0}.cshtml");
});
the {0} is just a place holder for the view name. Nice and simple.