diff --git a/src/Umbraco.Web/Mvc/RenderActionInvoker.cs b/src/Umbraco.Web/Mvc/RenderActionInvoker.cs index b846b23be6..1ab341dea7 100644 --- a/src/Umbraco.Web/Mvc/RenderActionInvoker.cs +++ b/src/Umbraco.Web/Mvc/RenderActionInvoker.cs @@ -11,10 +11,7 @@ namespace Umbraco.Web.Mvc /// Ensures that if an action for the Template name is not explicitly defined by a user, that the 'Index' action will execute /// public class RenderActionInvoker : AsyncControllerActionInvoker - { - - private static readonly ConcurrentDictionary IndexDescriptors = new ConcurrentDictionary(); - + { /// /// Ensures that if an action for the Template name is not explicitly defined by a user, that the 'Index' action will execute /// @@ -32,16 +29,8 @@ namespace Umbraco.Web.Mvc //check if the controller is an instance of IRenderMvcController if (controllerContext.Controller is IRenderMvcController) { - var methodInfo = controllerContext.Controller.GetType().GetMethods() - .First(x => x.Name == "Index" && - x.GetCustomAttributes(typeof (NonActionAttribute), false).Any() == false); - - ad = typeof (Task).IsAssignableFrom(methodInfo.ReturnType) - ? new TaskAsyncActionDescriptor(methodInfo, "Index", controllerDescriptor) - : (ActionDescriptor) new ReflectedActionDescriptor(methodInfo, "Index", controllerDescriptor); - - return IndexDescriptors.GetOrAdd(controllerContext.Controller.GetType(), type => ad); - } + return controllerDescriptor.FindAction(controllerContext, "Index"); + } } return ad; }