I’m looking for the library which provides the expression printing functionality (from the lambdas converted to expression trees). In other words it should do similar job to parsing examples here, but should be obviously far more complete. Is anyone aware of such library?
I’m looking for the library which provides the expression printing functionality (from the lambdas
Share
If you want some textual representation of the expression and you don’t care how exactly does it look like, you can use
ToString(). All of theExpressiontypes override this method.For example, for the simple expression
num => num < 5,ToString()returnsnum => (num < 5). But for more complicated expressions, it doesn’t look like C# code anymore. For example, fornum => num < Math.Pow(5,5), it returnsnum => (Convert(num) < Pow(5, 5)).