I want o bind my controller with a parameter that is lazy evaluated.
protected override IController GetControllerInstance(RequestContext requestContext, Type controllerType)
{
try
{
return controllerType == null
? null
: (IController) _ninjectKernel.Get(controllerType);
}
catch (Exception ex)
{
throw;
}
}
And I have the next binding:
_ninjectKernel.Bind<IFilesRepository>().To<FilesManager>().WithConstructorArgument("storageFolderAbsolutePath", c => c.ToString());
The problem is at the lambda function. I want to return Server.MapPath("/") ... but I don't have the request context in the c object. How can I sent it?