From 307ba8b0961835aa5263461d147568d7b3fe43a2 Mon Sep 17 00:00:00 2001 From: Suha Can Date: Fri, 2 Apr 2010 16:40:57 -0700 Subject: [PATCH] - Passing interface type when creating named services for mvc controllers... --HG-- branch : dev --- src/Orchard/Mvc/OrchardControllerFactory.cs | 1 - src/Orchard/Mvc/OrchardControllerIdentificationStrategy.cs | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Orchard/Mvc/OrchardControllerFactory.cs b/src/Orchard/Mvc/OrchardControllerFactory.cs index 2fd58261e..e3d603dd2 100644 --- a/src/Orchard/Mvc/OrchardControllerFactory.cs +++ b/src/Orchard/Mvc/OrchardControllerFactory.cs @@ -21,7 +21,6 @@ namespace Orchard.Mvc { // Now that the request container is known - try to resolve the controller object controller; - List paramlist = new List { TypedParameter.From(requestContext) }; if (container != null && container.TryResolve(new NamedService(serviceName, typeof(IController)), new List{TypedParameter.From(requestContext)}, out controller)) { return (IController)controller; diff --git a/src/Orchard/Mvc/OrchardControllerIdentificationStrategy.cs b/src/Orchard/Mvc/OrchardControllerIdentificationStrategy.cs index b50715f0e..b23802b19 100644 --- a/src/Orchard/Mvc/OrchardControllerIdentificationStrategy.cs +++ b/src/Orchard/Mvc/OrchardControllerIdentificationStrategy.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Web.Mvc; using Autofac.Core; using Autofac.Integration.Web.Mvc; using Orchard.Extensions; @@ -41,7 +42,7 @@ namespace Orchard.Mvc { areaName = assemblySimpleName; } var controllerName = controllerType.Name.Replace("Controller", ""); - return new NamedService(("controller." + areaName + "." + controllerName).ToLowerInvariant(), controllerType); + return new NamedService(("controller." + areaName + "." + controllerName).ToLowerInvariant(), typeof(IController)); } } } \ No newline at end of file