简体   繁体   English

单个解决方案中的多个MVC项目

[英]Multiple MVC projects in a single solution

I have seen in NopCommerce project that there is a solution and there are multiple MVC projects within the solution. 我在NopCommerce项目中看到有一个解决方案,解决方案中有多个MVC项目。

I have some questions about it such as : 我有一些问题,例如:

How is it possible to share a main layout, or use different layout on demand? 如何共享主要布局或按需使用不同的布局?
How is it possible to use Controllers/Models etc. in different MVC projects? 如何在不同的MVC项目中使用控制器/模型等?

I would also like one main project and multiple sub MVC projects. 我还想要一个主要项目和多个子MVC项目。 How can this be done while sharing components? 如何在共享组件时完成此操作?

Any ideas? 有任何想法吗? pointers? 指针?

Note: Not interested in Areas. 注意:对区域不感兴趣。

Yes it is. 是的。 See: asp.net mvc put controllers into a separate project 请参阅: asp.net mvc将控制器放入单独的项目中

I've done this myself and was able to use the controllers in a plug-in type architecture. 我自己做了这个,并且能够在插件式架构中使用控制器。

As for the models, they are just normal classes. 至于模型,它们只是普通的类。 They can be used in any project for any reason. 它们可以出于任何原因用于任何项目。 There is nothing special about them. 他们没什么特别的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM