I have multiple resources which I want to expose through following URIs
- http:///countries GET
- http:///states?countryCode=** GET
- http:///persons GET, POST, PUT, DELETE
I am using Asp.Net Web API to build RESTful service to access these resource.
What would be the best practice while creating controllers for these? Should I create separate controller for each resource? Or there is some way to map these urls to actions of a single controller?
Single controller class will help If I use DependencyResolver as I saw DependencyResolver can return instance of a single Controller. (I may be wrong here)
I need dependency resolver as my controller classes will have some repository object through constructor injection.
I won't use any IoC, only poor man's DI.
One Addition
I have successfully designed this problem in WCF Web Api used for REST, but not in Asp.Net Web API. I am new in this.