Edit this page

Overview

The engine that powers RadExpressionEditor enables us to parse a string into a LINQ expression, which can be consumed by any API accepting a LINQ expression.

RadExpressionEditor always generates a LambdaExpression with one parameter. The type of the parameter is inferred from the value of the Item property of RadExpressionEditor instance. For more information on lambdas, please refer to the Lambdas help topic.

Once the Expression is available, you can also compile it manually like so:

var expr = (LambdaExpression)ExpressionEditor.Expression;
if (expr != null)
{
    var newBody = System.Linq.Expressions.Expression.Convert(expr.Body, typeof(int));
    var expr2 = System.Linq.Expressions.Expression.Lambda(newBody, expr.Parameters) as Expression<Func<Club, int>>;
    var func = expr2.Compile();
}

Here are the basic concepts of the expression engine: