Tuesday, October 9, 2012

Web Api - Ninject & IHttpControllerActivator

I was reading through the following blog posts today by Mike Seemann:
  • Dependency Injection and Lifetime Management with ASP.NET Web Api
  • Dependency Injection in ASP.NET Web Api with Castle Windsor
In his posts, Mike shows how to use the IHttpControllerActivator to wire up Dependency Injection (DI) without using the built in IDependencyResolver in the Web Api bite. After reading through both of these, I was inspired to create the Ninject based equivalent DI leveraging the IHttpControllerActivator.

Here is the class that I created for this:

A complete sample application is available from https://github.com/paigecook/WebApiNinjectIHttpControllerActivator


Partywear saree said...

We are really grateful for your blog post. You will find a lot of approaches after visiting your post.

Pakar SEO Indonesia said...

this code I was looking for , need information and glad to find your site, thank you share it very useful