Skip to content

Instantly share code, notes, and snippets.

@mahizsas
Forked from jbogard/Featurefolders.cs
Created August 19, 2014 15:42
Show Gist options
  • Save mahizsas/6967be19af8beae72c7a to your computer and use it in GitHub Desktop.
Save mahizsas/6967be19af8beae72c7a 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