Add ActionResult invoker
danieltian opened this issue · 3 comments
I noticed that Ninject.Web.Mvc
has an ActionFilter
invoker, to inject dependencies into an ActionFilter
. Is it possible to do the same for ActionResults
?
As ActionResults are created in Actions of a controller you have to inject a IKernel(or better IResolutionRoot) into your controller (or better a result factory that is inected to the controller) and let the kernel create the desired action result.
Or do you mean IResultFilter? They are injected too.
I want to be able to inject some custom ActionResults
for my application. The current problem I'm dealing with is detailed here:
I did find this post that illustrates how to do it:
But unfortunately, it's written for StructureMap
and I don't know enough about Ninject
to be able to add it to Ninject.Web.Mvc
.
Answered on stackoverflow