Skip to content

Commit

Permalink
type filter added
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelbaran authored and Fraser Greenroyd committed Feb 24, 2021
1 parent b3a740b commit a9c9d84
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Reflection_Engine/Modify/SortExtensionMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public static partial class Modify
[Output("metods", "Sorted methods")]
public static List<MethodInfo> SortExtensionMethods(this IEnumerable<MethodInfo> methods, Type type)
{
IEnumerable<MethodInfo> typeMethods = methods.Where(x => x.GetParameters()[0].ParameterType.IsAssignableFrom(type));
return methods.OrderBy(x => methods.Count(y => x.GetParameters()[0].ParameterType.IsAssignableFrom(y.GetParameters()[0].ParameterType))).ToList();
}

Expand Down

0 comments on commit a9c9d84

Please sign in to comment.