MethodAccessorInvoke(Object, Object) Method

Invokes the method with one parameter. The return value of void methods is always . For static methods the instance parameter is omitted (can be ).
See the Remarks section of the Invoke(Object, Object) overload for details.

Definition

Namespace: KGySoft.Reflection
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
public Object? Invoke(
	Object? instance,
	Object? param
)

Parameters

instance  Object
The instance that the method belongs to. Can be for static methods.
param  Object
The value of the parameter.

Return Value

Object
The return value of the method, or for void methods.

Exceptions

ArgumentNullExceptionThis MethodAccessor represents an instance method and instance is .
ArgumentExceptionThe type of instance or param is invalid.
-or-
The method cannot be invoked with one parameter.
InvalidOperationExceptionThis MethodAccessor represents an open generic method or a method of an open generic type.
NotSupportedExceptionOn .NET Framework the code is executed in a partially trusted domain with insufficient permissions.
PlatformNotSupportedExceptionYou use the .NET Standard 2.0 build of KGySoft.CoreLibraries and this MethodAccessor represents a ref-returning method.

See Also