Say I have a DLL assembly, containing an auto-generated class with two methods:
public class AutoGeneratedClass
{
public int DoSomething(bool forReal) { ??? }
public void DoSomethingElse(string whatever) { ??? }
}
The methods could be anything, really. The above is just an illustration.
What kind of code would I need to generate in place of ??? above to have it automatically pack up parameters of the call and send them to a single generic method on another class, which would then actually handle the call and return the result?
public class GenericClass
{
public ??? GenericHandler(???) { ??? }
}
I guess I'm looking for something that works similar to Expression<Func<...>>
in LINQ, which compiles to a data structure that can be sent anywhere and taken apart there.
I would like to keep the original method prototypes the same as if they were normal, locally implemented methods, though, to keep the caller of the AutoGeneratedClass non the wiser.
If this cannot be achieved, what are my options?
Thank you!