/// <summary> /// Determines whether formal parameters of both methods are equal by type /// and return types are also equal. /// </summary> /// <param name="method">The first method to compare.</param> /// <param name="other">The second method to compare.</param> /// <param name="respectCallingConvention"><see langword="true"/> to check calling convention; <see langword="false"/> to ignore calling convention.</param> /// <returns><see langword="true"/>, if both methods have the same number of formal parameters, parameters are equal by type and return types are equal; otherwise, <see langword="false"/>.</returns> public static bool SignatureEquals(this MethodInfo method, MethodInfo other, bool respectCallingConvention = false) => SignatureEquals(method.As <MethodBase>(), other, respectCallingConvention) && method.ReturnType == other.ReturnType;