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

3 comments:

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

olive oil ear infection said...

Good morning and thank you for the video! I have VS 2017 Community, Xamarin Installed, Live Player Enabled. I can pair my google pixel 2 to the live player using the QR code, and it shows up in the "Xamarin Live Player" window as "Google Pixel 2 Player - Android". But it never shows up as a device to debug on. The pulldown for my play button only shows my emulators and "Live Player". Which if I click on "Live Player" it just reopens the "Xamarin Live Player" window I used to pair my device. (BTW my device is still shown in this window.