Search code examples
asp.net-mvcarchitecturerazorvirtualpathprovider

Vertical asp.net MVC organization and VirtualPathProviders


I'm currently working on a relatively large MVC project I would like to organize vertically.

Why break convention? And, in more detail here

As far as implementation goes, the plan is a VirtualPathProvider. My question is, what would the best way be to give this VirtualPathProvider knowledge of the feature folder names?

e.g. ~/Features/{Feature}/View1.cshtml


Solution

  • If you plan to do this, I would definately NOT use a VirtualPathProvider. The reason is that path searches are expensive. The more paths you have, the longer it takes to find them.

    I would instead specify paths directly. You lose the convention aspect, but you gain performance.