|
by Alexandra Rusina via C# Frequently Asked Questions : on 11/19/2009 8:05:00 PM
First of all, let’s take a look at the example from one of my previous posts. It creates an expression tree for calculating the factorial of a number.ParameterExpression value =
Expression.Parameter(typeof(int), "value");
ParameterExpression result =
Expression.Parameter(typeof(int), "result");
LabelTarget label = Expression.Label(typeof(int));
BlockExpression block = Expression.Block(
new[] { result },
Expression.Assign(result, Expression.Constant(1)),
Expression.Loop(
... [ read more ]
|
|