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
SystemObject
  TomsToolbox.EssentialsDefaultValue

Namespace: TomsToolbox.Essentials
Assembly: TomsToolbox.Essentials (in TomsToolbox.Essentials.dll) Version: 2.21.0+44d18b541fc9419ec3c549350a832394661b2a4d
XMLNS for XAML: Not mapped to an xmlns.
Syntax
public static class DefaultValue

The DefaultValue type exposes the following members.

Methods
 NameDescription
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.
Top
See Also