I would like to create a function that converts a "C# function call" to a string. For example: In my C# Project there is a public function, that can be called like this:
myTestClass.myTestFunction();
It's a function without arguments and returnvalue. Now I would like to implement another function that accepts a C# "Expression" as argument and converts the "Expression" to a string:
Expression<Func<???>> expr = () => myTestClass.myTestFunction();
string myString="";
myString=convertExpressionToString(expr);
myString should contain now "myTestClass.myTestFunction();" It is important that the complete function call including the class name is inside the string.
Any ideas how to solve this?
nameof()function