Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

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?

I would also like one main project and multiple sub MVC projects. How can this be done while sharing components?

Any ideas? pointers?

Note: Not interested in Areas.

like image 769
DarthVader Avatar asked Jul 05 '13 13:07

DarthVader


People also ask

Should you split your ASP NET MVC project into multiple projects?

It shouldn't! That's why it's designed in a modular way. In most web applications out there, we version and deploy all these assemblies (Web, BLL and DAL) together. So, separating a project into 3 projects does not add any values.

Can MVC have multiple views?

-Model View Controller (MVC): a single model is mapped to multiple views: the different synchronized channels. Multiple controllers act on and transform the underlying model by interacting via one or more views.

Can you mix razor pages and MVC?

You can add support for Pages to any ASP.NET Core MVC app by simply adding a Pages folder and adding Razor Pages files to this folder. Razor Pages use the folder structure as a convention for routing requests.

What are the three models of MVC?

In fact, in ASP.NET MVC, there are three distinct types of model: the domain model, view model and input model.


1 Answers

Yes it is. See: asp.net mvc put controllers into a separate project

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.

like image 90
Ryan Bennett Avatar answered Oct 08 '22 12:10

Ryan Bennett