0

I have a service that takes HttpControllerContext for constructor injection. What is the binding for this? The bindings are setup in the NinjectWebCommon file under WebActivator.

By binding, I mean like this:

kernel.Bind<IUserService>().To<UserService>();
kernel.Bind<HttpControllerContext>().To</* ??? */ >(); //Whats the binding?
Shawn Mclean
  • 56,733
  • 95
  • 279
  • 406
  • this might help: http://blog.ploeh.dk/2012/04/19/WiringHttpControllerContextWithCastleWindsor.aspx – tugberk Aug 06 '12 at 06:01
  • @tugberk I've read that and his previous posts a few times but I can't seem to understand it at the level of how to do it in ninject and his site is the only thing that came up in searches. – Shawn Mclean Aug 06 '12 at 06:32
  • Are you still having this problem? There is a newer post [here](http://blog.ploeh.dk/2012/10/03/DependencyInjectioninASP.NETWebAPIwithCastleWindsor/) and you will just need to implement a class: `public class ContextCapturingControllerActivator : IHttpControllerActivator` and bind it as `kernel.Bind().To();` – Colin Young Jan 23 '14 at 15:12

0 Answers0