mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 03:25:23 +08:00
- Passing interface type when creating named services for mvc controllers...
--HG-- branch : dev
This commit is contained in:
@@ -21,7 +21,6 @@ namespace Orchard.Mvc {
|
||||
|
||||
// Now that the request container is known - try to resolve the controller
|
||||
object controller;
|
||||
List<Parameter> paramlist = new List<Parameter> { TypedParameter.From(requestContext) };
|
||||
if (container != null &&
|
||||
container.TryResolve(new NamedService(serviceName, typeof(IController)), new List<Parameter>{TypedParameter.From(requestContext)}, out controller)) {
|
||||
return (IController)controller;
|
||||
|
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user