/// <summary>
        /// Outputs a given expression tree to a string.
        /// </summary>
        /// <param name="node">The expression node.</param>
        /// <returns>The string representing the expression.</returns>
        public static new string ExpressionToString(Expression node)
        {
            node.CheckNotNull(nameof(node));

            var expressionStringBuilder = new ImprovedExpressionStringBuilder(node is LambdaExpression);

            try
            {
                expressionStringBuilder.Visit(node);

                return(expressionStringBuilder.ToString());
            }
            catch
            {
                return(node.ToString());
            }
        }
Exemple #2
0
 private static string ConvertToString(Expression expression) =>
 ImprovedExpressionStringBuilder.ExpressionToString(expression);