System.Reflection.ParameterInfo.DefaultValue Property

Gets a value indicating the default value if the parameter has a default value.

Syntax

public virtual object DefaultValue { get; }

Value

Documentation for this section has not yet been entered.

Remarks

This property is used only in the execution context. In the reflection-only context, use the ParameterInfo.RawDefaultValue property instead.

The default value is used when an actual value is not specified in the method call. A parameter can have a default value that is null. This is distinct from the case where a default value is not defined.

This method utilizes the ParameterInfo.DefaultValueImpl method.

To get the System.Reflection.ParameterInfo array, first get the method or the constructor and then call MethodBase.GetParameters.

Requirements

Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0