Skip to content

Commit

Permalink
Simplified logic for finding index method when placing `MvcSiteMapNod…
Browse files Browse the repository at this point in the history
…eAttribute` on the controller level (so compatible with DNX core).
  • Loading branch information
NightOwl888 committed Oct 14, 2015
1 parent f74418e commit 4c3a73d
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<MethodInfo>())
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)
Expand Down

0 comments on commit 4c3a73d

Please sign in to comment.