Unity (Dependency Injection) and Web Api

For Web API, use Unity Bootstraper for web api.

I was using bootrapper for MVC and I was getting an error asking for a parameterless controller constructor.

Installed bootstrapper for web api from Nuget, at the web api project and problem solved.

More details on the cause at this discussion: Cannot inject dependencies…


Leave a Reply

Your email address will not be published. Required fields are marked *