I have a C# application, and I want to run a function which is defined in text to take one parameter of class A and return a double.
Parameter "A" will be some structured data, and the function will be a formula upon A.
(Imagine A had properties num1, num2, and one formula was defined to return the average, another arbitrarily to return num1 * 2).
As such, I want to load my function definition from a text source, compile them in some manner, and execute them.
In terms of the structure of the code, I do suppose I could inject the body of the function to be a member function of an arbitrary class, or if I can compile a delegate and then execute it passing a parameter context that would be sufficient also.
What is the way to go about this?