I'm currently working on a relatively large MVC project I would like to organize vertically.
我目前正在开发一个相对较大的MVC项目,我想垂直组织。
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
例如~ / / {功能} / View1.cshtml特性
1 个解决方案
#1
2
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.
我将直接指定路径。您失去了常规方面,但是您获得了性能。
#1
2
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.
我将直接指定路径。您失去了常规方面,但是您获得了性能。