Skip to content

Instantly share code, notes, and snippets.

@alistair
Forked from jbogard/Featurefolders.cs
Last active August 29, 2015 14:08
Show Gist options
  • Save alistair/26d56e1561b6652d27d9 to your computer and use it in GitHub Desktop.
Save alistair/26d56e1561b6652d27d9 to your computer and use it in GitHub Desktop.
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