I am creating a REST service that will expose for example customers and suppliers and each have associated contacts
I want to be able to route to:
- /contacts
- /contacts/{id}
- /suppliers/{supplierId}/contacts
- /suppliers/{supplierId}/contacts/{id}
- /customers/{customerId}/contacts
- /customers/{customerId}/contacts/{id}
I know I can easily add:
[Route("/contacts", "GET")]
[Route("/contacts/{id}", "GET")]
[Route("/{Entity}/{EntityId}/contacts", "GET")]
[Route("/{Entity}/{EntityId}/contacts/{id}", "GET")]
Class ContactsRequest :IReturn<ContactsResponse>{
...
}
But I want to be able to use my Contacts Service where it could be at the end of a "deeper" route for example:
- /sales/leads/{leadId}/referers/customers/{customerId}/contacts
- /sales/leads/{leadId}/referers/customers/{customerId}/contacts/{id}
I am planing on using this API with restangular, I want to be able to drill down the api from anywhere in the app. Any Suggestions?