mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 11:44:58 +08:00
Inverting Lazy and Meta to avoid instantiating controller to get it's type
--HG-- branch : perf
This commit is contained in:
@@ -36,10 +36,10 @@ namespace Orchard.Mvc {
|
||||
var serviceKey = (areaName + "/" + controllerName).ToLowerInvariant();
|
||||
|
||||
// Now that the request container is known - try to resolve the controller information
|
||||
Lazy<Meta<IController>> info;
|
||||
Meta<Lazy<IController>> info;
|
||||
var workContext = requestContext.GetWorkContext();
|
||||
if (TryResolve(workContext, serviceKey, out info)) {
|
||||
return (Type) info.Value.Metadata["ControllerType"];
|
||||
return (Type) info.Metadata["ControllerType"];
|
||||
}
|
||||
|
||||
return null;
|
||||
|
Reference in New Issue
Block a user