I'm using NInject as the default container and the NInjectResolver class on an MVC4 project. Injection works great.
Now I'm trying to replace the default IActionInvoker
in order to provide custom JSON serialization as shown here.
This seems to work OK if the action returns JsonResult
but it chokes on Task<JsonResult>
(even if I bind IActionInvoker
to the default ControllerActionInvoker
).
When I convert it to an async action, the action returns (instead of JSON), this text: System.Threading.Tasks.Task<System.Web.Mvc.JsonResult>
- like calling ToString()
on it.
How do I go about fixing this?