Click or drag to resize

DefaultValue Class

Helper methods to get the default value for a type when the type is only available at runtime.
Inheritance Hierarchy

Namespace:  TomsToolbox.Core
Assembly:  TomsToolbox.Core (in TomsToolbox.Core.dll) Version:
public static class DefaultValue

The DefaultValue type exposes the following members.

Public methodStatic memberCreateDefault
Creates the default value (C#: default(T)) for the specified type, where the type is only known at runtime.


Public methodStatic memberCreateEmpty
Create an empty value that is not null for value types or strings.
  • Value type: The empty value is the same as the default value (usually 0).
  • String: The empty value is an empty string.
  • All other reference types: null.


See Also