Explicitly injecting the Controller's ActionInvoker since upgrading to MVC3P1 somehow broke the InjectActionInvoker extension method

--HG--
branch : mvc3p1
This commit is contained in:
Nathan Heskew 2010-08-17 22:36:02 -07:00
parent 69c901e5c0
commit 610d79fde6

View File

@ -93,7 +93,11 @@ namespace Orchard.Environment.ShellBuilders {
.EnableDynamicProxy(dynamicProxyContext)
.Keyed<IController>(serviceKey)
.InstancePerDependency()
.InjectActionInvoker();
.OnActivating(e => {
var controller = e.Instance as Controller;
if (controller != null)
controller.ActionInvoker = (IActionInvoker)e.Context.Resolve(new TypedService(typeof(IActionInvoker)));
});
}
// Register code-only registrations specific to a shell