-
-
Save mikesigs/19804386440e089ce7a9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FeatureViewLocationRazorViewEngine : RazorViewEngine | |
{ | |
public FeatureViewLocationRazorViewEngine() | |
{ | |
ViewLocationFormats = new[] | |
{ | |
"~/Features/{1}/{0}.cshtml", | |
"~/Features/{1}/{0}.vbhtml", | |
"~/Features/Shared/{0}.cshtml", | |
"~/Features/Shared/{0}.vbhtml", | |
}; | |
MasterLocationFormats = ViewLocationFormats; | |
PartialViewLocationFormats = new[] | |
{ | |
"~/Features/{1}/{0}.cshtml", | |
"~/Features/{1}/{0}.vbhtml", | |
"~/Features/Shared/{0}.cshtml", | |
"~/Features/Shared/{0}.vbhtml", | |
}; | |
} | |
} | |
/* in global.asax */ | |
ViewEngines.Engines.Clear(); | |
ViewEngines.Engines.Add(new FeatureViewLocationRazorViewEngine()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment