Hello Guys,
Need some advice.
I got a string in the database:
"PerformInjection{param}DataDict{param}ObjectArray"
Now - I parse this string and split it into array:
[0] = "PerformInection"
[1] = "DataDict"
[2] = "ObjectArray"
Now what I need to do is to run the function, which name is in [0] and pass other string array elements as parameters to it. So finaly - such code should get executed:
PerformInjection(DataDict, ObjectArray);
Any thought on how to achieve this in the most graceful manner? (Please note that in this example I got only 2 parameters that should be passed to function. It might be that I will have 3,4,5 and so on parameters to pass. So the rule is simple - string[0] is always function name and everything else - parameters).
By the way - I've done resolving parameter values, so only need to find out the best approach how to get the function by name and pass those parameters that I got. Was thinking about delegates, but not sure if it's the best approach.
Thanks!