Inverting Lazy and Meta to avoid instantiating controller to get it's type

--HG--
branch : perf
This commit is contained in:
Louis DeJardin
2010-11-24 20:51:35 -08:00
parent 493fb03afe
commit c89aeb635c

View File

@@ -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;