Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Extension method: object GetDefaultValue(this Type)

Declaration

public static object GetDefaultValue(
    this Type type
)

Summary

Returns the equivalent of default(T) for a Type object. For reference or nullable types, this is null, while for value types, it is the default value (e.g. false, 0, etc.).

Parameters

this Typetype The type to retrieve the default value for.