Skip to content
Zev Spitz edited this page Dec 18, 2019 · 16 revisions

Welcome to the wiki for the ExpressionTreeToString library.

This library generates string representations of expression trees and related types:

Expression<Func<Person, bool>> expr = p => 
    p.LastName.StartsWith("A");

Console.WriteLine(expr.ToString("C#"));
/*
    (Person p) => p.LastName.StartsWith("A")
*/

Console.WriteLine(expr.ToString("Visual Basic"));
/*
    Function(p As Person) p.LastName.StartsWith("A")
*/
Clone this wiki locally