P
Patrick
Hello all,
I have a bunch of classes that implement the same static methods (same
name and same parameters).
However, their return types are different because they return an IList of
different types. I'm looking for a way to generically call these methods
without knowing the Type at runtime. Could someone please help with some
advice?
Here's my current work around:
IList Results = null;
switch (DataObject.Name)
{
case "AccountHistories":
Results = AccountHistories.RetrieveQuery(whereClause);
break;
case "ApplicationFiles":
Results = ApplicationFiles.RetrieveQuery(whereClause);
break;
case "Applications":
Results = Applications.RetrieveQuery(whereClause);
break;
case "ApplicationSettings":
Results = ApplicationSettings.RetrieveQuery(whereClause);
break;
I have a bunch of classes that implement the same static methods (same
name and same parameters).
However, their return types are different because they return an IList of
different types. I'm looking for a way to generically call these methods
without knowing the Type at runtime. Could someone please help with some
advice?
Here's my current work around:
IList Results = null;
switch (DataObject.Name)
{
case "AccountHistories":
Results = AccountHistories.RetrieveQuery(whereClause);
break;
case "ApplicationFiles":
Results = ApplicationFiles.RetrieveQuery(whereClause);
break;
case "Applications":
Results = Applications.RetrieveQuery(whereClause);
break;
case "ApplicationSettings":
Results = ApplicationSettings.RetrieveQuery(whereClause);
break;