c# - Using Variable as a class name reference -


i have interesting question today. have table stores void name , class file came from.

is possible read table , assign var object based off data in variable?

if , save ton of coding.

public void callmyfunction() {     try     {         var checkerlist = conn.queryasync<functionlist>("select * 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     {     } } 


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -