With Web API 2 and the recent addition, Attribute Routing gave me the idea of creating a central API application for our corporate needs.
But my problem is that a clean REST approach somewhat limits our data exchange needs in the enterprise.
So, after reading THIS, I decided to follow the mixing method:
Some controllers have pure REST and some have RPC style.
Good idea from the article on routing (slightly changed it for RpcApi to add {id} placeholder):
routes.MapHttpRoute( name: "RestApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); routes.MapHttpRoute( name: "RpcApi", routeTemplate: "services/{controller}/{action}/{id}", defaults: new { id = RouteParameter.Optional } );
What I need to solve and you need your advice:
The separation between REST and RPC style / Categorization of domain operations :
Would it be a good decision to create 2 areas in my web API? One for RPC and one for REST?
But then how will I classify the work of my domain at the same level? (ERP, CRM, payroll). Initially, I thought that these would be relevant areas.
Another idea is to create a physical separation for the controllers in separate folders under the controller folder, although this would mean that there are unique names for the controllers, since the subfolders are not related to the infrastructure.
Additional Information:
Interesting view of ASP.NET MVC / Web API project organization
Any ideas?