I am looking to get the calculated result value from the Telerik Expression control. There is a very useful link https://stackoverflow.com/a/5858922/1181910, but i am unable to understand one point in this post. My scenario is the same as mentioned in the above post, but my question is what is the ‘input’ variable here? Below is the code from the post (Explained very well by Jon Skeet):
var typeSafe = (Expression<Func<Finance, decimal?>>) ExpressionEditor.Expression;
var compiled = typeSafe.Compile();
var result = compiled(input);
Here ExpressionEditor.Expression will be a LINQ Expression from the Telerik control. I am not sure what should be given for input?
The type for
ExpressionEditor.ExpressionisExpression<Func<Finance, decimal?>>. So the input type isFinanceand the output type isdecimal?.The variable
inputmust be of typeFinance. Where it comes from depends on your app, but it must be initialized/set before you use it.