System.Linq.Expressions.Expression.CheckMethod C# (CSharp) Method

CheckMethod() private static method

private static CheckMethod ( MethodInfo method, MethodInfo propertyMethod ) : bool
method System.Reflection.MethodInfo
propertyMethod System.Reflection.MethodInfo
return bool
        private static bool CheckMethod(MethodInfo method, MethodInfo propertyMethod)
        {
            if (method.Equals(propertyMethod))
            {
                return true;
            }
            // If the type is an interface then the handle for the method got by the compiler will not be the
            // same as that returned by reflection.
            // Check for this condition and try and get the method from reflection.
            Type type = method.DeclaringType;
            if (type.GetTypeInfo().IsInterface && method.Name == propertyMethod.Name && type.GetMethod(method.Name) == propertyMethod)
            {
                return true;
            }
            return false;
        }
Expression