Class RuntimeTypeConverter
- Namespace
- JsonApiDotNetCore.Resources
- Assembly
- JsonApiDotNetCore.Annotations.dll
Provides utilities regarding runtime types.
[PublicAPI]
public static class RuntimeTypeConverter
- Inheritance
-
RuntimeTypeConverter
- Inherited Members
Methods
CanContainNull(Type)
Indicates whether the specified type is a nullable value type or a reference type.
public static bool CanContainNull(Type type)
Parameters
type
Type
Returns
ConvertType(object?, Type)
Converts the specified value to the specified type.
public static object? ConvertType(object? value, Type type)
Parameters
Returns
- object
The converted type, or
null
ifvalue
isnull
andtype
is a nullable type.
Exceptions
- FormatException
value
is not compatible withtype
.
GetDefaultValue(Type)
Gets the default value for the specified type.
public static object? GetDefaultValue(Type type)
Parameters
type
Type
Returns
- object
The default value, or
null
for nullable value types and reference types.