From 4c3a73db2b890787576b69c18d8ab7be012bda20 Mon Sep 17 00:00:00 2001 From: Shad Storhaug Date: Wed, 14 Oct 2015 16:51:33 +0700 Subject: [PATCH] Simplified logic for finding index method when placing `MvcSiteMapNodeAttribute` on the controller level (so compatible with DNX core). --- .../Builder/ReflectionSiteMapNodeProvider.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/MvcSiteMapProvider/MvcSiteMapProvider/Builder/ReflectionSiteMapNodeProvider.cs b/src/MvcSiteMapProvider/MvcSiteMapProvider/Builder/ReflectionSiteMapNodeProvider.cs index b3f1497f..770f023e 100644 --- a/src/MvcSiteMapProvider/MvcSiteMapProvider/Builder/ReflectionSiteMapNodeProvider.cs +++ b/src/MvcSiteMapProvider/MvcSiteMapProvider/Builder/ReflectionSiteMapNodeProvider.cs @@ -163,9 +163,8 @@ protected virtual ISiteMapNodeToParentRelation GetSiteMapNodeFromMvcSiteMapNodeA if (methodInfo == null) // try to find Index action { - var ms = type.FindMembers(MemberTypes.Method, BindingFlags.Instance | BindingFlags.Public, - (mi, o) => mi != null && string.Equals(mi.Name, "Index"), null); - foreach (MethodInfo m in ms.OfType()) + var ms = type.GetMethods(BindingFlags.Instance | BindingFlags.Public).Where(x => x.Name.Equals("Index")); + foreach (MethodInfo m in ms) { var pars = m.GetParameters(); if (pars.Length == 0)