Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

ReflectionUtils.GetDefaultValue Method

Returns the default value for the specified Type

[Visual Basic]
Public Shared Sub GetDefaultValue( _
   ByVal type As Type _
)
[C#]
public static object GetDefaultValue(
   Type type
);

Parameters

type
The Type to return default value for.

Return Value

The default value for the specified Type.

Remarks

Follows the standard .NET conventions for default values where relevant; for example, all numeric types default to the value 0.

Exceptions

Exception Type Condition
ArgumentException If the supplied type is an enumerated type that has no values.

See Also

ReflectionUtils Class | Spring.Util Namespace