I'm working on a project that is a API with many controllers and modules. Which of the following is the best architectural practice to organizing my API controllers by dll (.NET 4.7 WebAPI)? Why?
OBS: Each item is inside a module is a dll
- One dll for each controller. Each csproj contains only one Controller.cs file:
Module 1
-- API Controller 1-- API Controller 2
-- Domain
-- Application
-- InfraModule 2
-- API Controller 3-- API Controller 4
-- Domain
-- Application
-- Infra
- Group controllers in projects by context
Module 1
-- API-- Domain
-- Application
-- InfraModule 2
-- API-- Domain
-- Application
-- Infra
- Create only one csproj with all controllers.
Module 1
-- Domain
-- Application
-- InfraModule 2
-- Domain
-- Application
-- InfraAPI (controllers)
Note: I'm using DDD (as possible), separating my business rules by context. Each context has its layers: domain, application and infra.
I started centralizing all Controllers of all contexts in one api project. It started to be messy, so I break in separate projects. However, there is some performance issue or architectural pattern that should I follow to organize my project?