I was working on defining generic controller for my web application, similar to the one explained in this question. The difference is that, in my case, controller routing prefix can contain one (ie: /Person), two or (more general) n segments (ie. /hr/Employee, ...). The answer from Jeff Fritz suggested that custom IControllerFactory should be implemented. However, since my routing structure is pretty complex and, therefore, hard to implement using RouteAttribute or MapRoute function in Program.cs, provided custom IControllerFactory was not called and, thus, not working. I have seen that controller could be registered using custom IApplicationModelProvider implementation. I was wondering how should a generic controller be registered for it to contain all actions, properties, filters, route values and selectors as expected by the default IApplicationModelProvider implementation?
IControllerModelConventionand providing customIApplicationFeatureProvider) - I think it'll be both easier and cleaner than providing my ownIApplicationModelProvider. Thanks for advice.