Open sandboxFocus

Method ToParameterInfo

ToParameterInfo()

Gets a ParameterInfo that represents the current parameter at run time.

Declaration
ParameterInfo ToParameterInfo()
Returns
Type Description
ParameterInfo

A ParameterInfo that can be used only in run-time code.

Remarks

This method generates run-time code that retrieves the ParameterInfo object for the current parameter. While Metalama is designed to eliminate the need for reflection in most scenarios, this method is useful when you need to pass parameter metadata to APIs that require ParameterInfo objects.

Warning: The code generated by this method relies on method names and parameter positions, and may break if your project is obfuscated. Consider using the Value property to access parameter values directly when possible, as this approach is obfuscation-safe.

See Also