Esempio n. 1
0
        /// <summary>
        /// Gets the <see cref="MethodInfo"/> object of the body of the supplied expression.
        /// </summary>
        /// <param name="expression">
        /// The expression.
        /// </param>
        /// <returns>
        /// The <see cref="MethodInfo"/> object of the body of the supplied expression.
        /// </returns>
        public static MethodInfo GetMethodInfo(this LambdaExpression expression)
        {
            if (expression == null)
            {
                throw new ArgumentNullException("expression");
            }

            return(expression.GetBodyMethodCallExpression().Method);
        }