I am completely unfamiliar with the C # expression. I have some class, something like this
class SimpleClass
{
private string ReturnString(string InputString)
{
return "result is: "+InputString;
}
public string Return(Expression exp)
{
LambdaExpression lambda = Expression.Lambda(exp);
return lambda.Compile();
}
}
Now I would like to call this Return method with some parameter something (pseudo) as follows:
SimpleClass sc = new SimpleClass();
Expression expression = Expression.MethodCall(//how to create expression to call SimpleClass.ReturnString with some parameter?);
string result = sc.Return(expression);
Console.WriteLine(result);
Thanks for the help / answer.
Matt
user162085
source
share