I have an interesting question today. I have a table that stores a void name and from what class file it came from.
Is it possible to read the table and assign a var object based off the data in a variable?
If it is , it would save a ton of coding.
public void CallMyFunction()
{
try
{
var checkerList = conn.QueryAsync<FunctionList>("SELECT * FROM FunctionList",null );
using (IEnumerator<FunctionList> enumer = checkerList.Result.GetEnumerator())
{
while (enumer.MoveNext())
{
FunctionList current = enumer.Current;
string myFunctionToCall = current.FunctionName ;
string myObjectToCall = current.FunctionObject;
MethodInfo dynMethod = this.GetType().GetMethod(myFunctionToCall,
BindingFlags.NonPublic | BindingFlags.Instance);
dynMethod.Invoke(myObserverToCall, new object[] { myFunctionToCall });
}
}
}
catch
{
}
}