public static bool IsMatchedTo(this MethodInfo firstMethod, MethodInfo secondMethod) { if (secondMethod.IsNull() || !firstMethod.Name.Equals(secondMethod.Name) || !MatchReturnType(firstMethod.ReturnType, secondMethod.ReturnType)) { return false; } return MatchParameters(firstMethod.GetParameters(), secondMethod.GetParameters()); }
public static bool IsMatch(this string str, MethodInfo methodInfo) { if (methodInfo.IsNull()) return false; var methodName = methodInfo.Name.Replace("_", "(.*)"); if (methodName.IndexOf("(.*)") == -1) return str.RemoveAccents().ToUpper() == methodName.RemoveAccents().SplitCamelCase().ToUpper(); return Regex.IsMatch(str.RemoveAccents().ToUpper(), "^" + methodName.RemoveAccents().SplitCamelCase().ToUpper()); }