Can i pass strings as arguments during method.Invoke(objectname,object[]params) for a method of signature Getdetails(int,string,bool) without casting them to respective types before passing?
Will reflection handle the casting or should i be dynamically cast this to appropriate param types matching the function signature? I am calling couple of methods with different signatures in the same application.
So,here is the scenario:
I store the methodId with parameter types and values in a table.and then retrieve them and call using reflections. But i get a TargetInvocationException or Cannot convert System.String to System.Int32.
It will not handle. You have to create and pass an object array: