Example #1
0
        // public static methods
        /// <summary>
        /// Finds the first parameter in an expression.
        /// </summary>
        /// <param name="node">The expression containing the parameter that should be found.</param>
        /// <returns>The first parameter found in the expression (or null if none was found).</returns>
        public static ParameterExpression FindParameter(Expression node)
        {
            var finder = new ExpressionParameterFinder();

            finder.Visit(node);
            return(finder._parameter);
        }
Example #2
0
 // public static methods
 /// <summary>
 /// Finds the first parameter in an expression.
 /// </summary>
 /// <param name="node">The expression containing the parameter that should be found.</param>
 /// <returns>The first parameter found in the expression (or null if none was found).</returns>
 public static ParameterExpression FindParameter(Expression node)
 {
     var finder = new ExpressionParameterFinder();
     finder.Visit(node);
     return finder._parameter;
 }