Mutiplos projects in MVC and Webapi

Asked

Viewed 424 times

4

I’m looking for if there are any project models that involve multiple MVC and Webapi projects. In the solution I’m thinking about designing (if possible) a content management solution for multiple customers and I’m thinking about it as follows:

I wanted to have a Father project where it would be the core "core" of my application and the rest would be sub-projects where I will call them "modules" in which, these modules could be versioned. Let’s imagine the following senary:

Main project in MVC where I manage users and customers. Then I need to develop a News management module, another Photos management module.

SG.MVC -> Master Page, homepage and module management

SG.Modulo.Core -> Interfaces required for module development and included in the MVC application

SG.Modulo.News.V1

SG.Modulo.Noticia.V2

SG.Modulo.Photo.V1

SG.Modulo.Portifolio.V1

How could I compile these modules into separate projects and then inject these modules in the main application, not being necessary to recompile and adapt the main application every time it has to include a new module delivering a unique project dynamically, an example would be a wordpress, joomla where modules can be inserted.

I thought to search the modules (compiled in dll) saved in a folder, or else manage the existence of that module in a database showing where the dll of each module is located. Any light at the end of the tunnel will be welcome.

2 answers

3

I worked in a company that had a huge ERP and they had a very well made division of the various modules of the system. The structure they used was basically like this:

  • TFS was used for version control, and I confess that it was much nicer than using Git;
  • Each module of the system had its own Visual Studio Solution and all were in version control;
  • Base modules compiled for libraries (DLL);
  • Base modules had a custom build output directory that was specific to all of them, a folder that wasn’t versioned, that is, when a base module was compiled, a DLL was generated in that folder and the same was true for all other base modules, at the end you had a folder with all the basic Dlls for the operation of the modules, and that was the key of the story, because that way these Dlls could be easily referenced by the main modules, without that there are problems related to directories.

Well, this is an interesting way to approach this problem and it’s the way I would use it if I needed to put together a big project and in a way that could be easily expanded.

1

I was able to inject Class Libraries into MVC using Unity.Mvc. However, some warnings need to be given:

  • Unity conflicts with ASP.NET Identity. I could never solve the configuration to work;
  • As Views must exist in the main module;
  • Route configuration needs to be done using [Route].

Browser other questions tagged

You are not signed in. Login or sign up in order to post.