Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ExpressionType.Quote

What is the purpose of this UnaryExpression, and how should it be used?

like image 244
Eric Smith Avatar asked Oct 16 '08 07:10

Eric Smith


1 Answers

It takes an Expression object and wraps it with another Expression. For instance, if you have an expression which is for a lambda, using it in the tree will create a lambda expression, but using it quoted will result in an expression for a lambda in the output.

method                                 | resulting object                   | after compile
--------------------------------------------------------------------------------------------------
Expression.Lambda(...                  | Expression of lambda               | Lambda
Expression.Quote(Expression.Lambda(... | Expression of expression of lambda | Expression of lambda 
like image 72
Omer van Kloeten Avatar answered Oct 02 '22 17:10

Omer van Kloeten