Dependency Resolver for Api Controllers #11

Open
krokonoster opened this Issue Aug 24, 2012 · 0 comments

Projects

None yet

1 participant

@krokonoster

Asp.Net Web Api use System.Web.Http.ApiController instead of System.Web.Mvc.Controller

For this reason, when one add a Asp.Net Web Api (MVC 4 project) to your solution and implement SharpLite's dependency injection functionality, one will get a "No parameterless constructor" error when calling a api controller action.

Would it be possible to modify MyProject.Init to have a dependency resolver as it have now, but also a second on as per this implementation to be used by Api Controllers?

This way I could have an MVC project (like now) getting it's dependency resolver from that assembly, as well as add a asp.net web api project getting a different dependency resolver as required by api controllers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment