I have one of several methods (Strategy1, Strategy2), ... that need to be called depending on an id that is passed in.
Is it possible to save a method name in a db and call that method using the stored name?
Currently I have the StrategyID saved as an enum and use a switch statement matching passed in ID's with the appropriate strategy enum. I don't like this solution as you need to keep the enum synchronised with the Strategies db table.
What I want to do is take the switch out of the front end and put it in the db. So essentially I can make a db call (FetchStrategiesToRun) and the appropriate list of Strategies will be returned and I can loop through them calling the method directly.
If so, how. And if so, is there any reason I'd not be wanting to do this?