I'm realtively new to c# expression. I have some class something like that
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 method Return with some paramter something (pseudo) like this:
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 help/answer.
Matt