Share this page

# InvokeGenericMethod

.NET Vuser Functions

Invokes a generic method.

    object  InvokeGenericMethod (object targetObj , Type type , string methodName , int metadataToken , Type[] genericArguments , object[] parameters);

targetObj | The target upon which to invoke the method.
type | The method type.
methodName | The name of the method.
metadataToken | The metadataToken of the method.
genericArguments | The generic arguments with which to make the generic method invokable.
parameters | The method parameters.

InvokeGenericMethod invokes a generic method indicated by its name, type, and metadataToken. It returns the result of the method invocation.

Note: Do not add this function manually to a script. It is generated by VuGen automatically.

## Parameterization

Parameterization is not applicable to this function.

## Example

This example invokes the MyTest method.

Copy code

    public string Test(string t1, int t2) {
             object[] parameters = new object[] { t1, t2};
             object result = LrReplayUtils.InvokeGenericMethod(this.target, "MyTest", 100663407, new System.Type[] { typeof(string)}, parameters);
             return ((string)(result));
    }

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: