JsonValueExtensions Class

Provides extension methods for JsonValue conversions.

Definition

Namespace: KGySoft.Json
Assembly: KGySoft.Json (in KGySoft.Json.dll) Version: 3.0.0
C#
public static class JsonValueExtensions
Inheritance
Object    JsonValueExtensions

Methods

AsBigInteger Gets the specified JsonValue as a BigInteger value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to BigInteger; otherwise, returns .
AsBoolean Gets the specified JsonValue as a Boolean value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to Boolean; otherwise, returns . This method allows interpreting numeric values as booleans where nonzero values are .
AsByte Gets the specified JsonValue as a Byte value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to Byte; otherwise, returns .
AsDateOnly(JsonValue, String) Gets the specified JsonValue as a DateOnly value using the specified format if Type property of the specified json parameter is String and it can be converted to DateOnly; otherwise, returns .
AsDateOnly(JsonValue, JsonDateTimeFormat, JsonValueType) Gets the specified JsonValue as a DateOnly value using the specified format if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to DateOnly; otherwise, returns .
AsDateTime(JsonValue, JsonDateTimeFormat, JsonValueType) Gets the specified JsonValue as a DateTime value using the specified format if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to DateTime; otherwise, returns .
AsDateTime(JsonValue, String, NullableDateTimeKind) Gets the specified JsonValue as a DateTime value using the specified format if Type property of the specified json parameter is String and it can be converted to DateTime; otherwise, returns .
AsDateTime(JsonValue, JsonDateTimeFormat, NullableDateTimeKind, JsonValueType) Gets the specified JsonValue as a DateTime value using the specified format if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to DateTime; otherwise, returns .
AsDateTimeOffset(JsonValue, String) Gets the specified JsonValue as a DateTimeOffset value using the specified format if Type property of the specified json parameter is String and it can be converted to DateTimeOffset; otherwise, returns .
AsDateTimeOffset(JsonValue, JsonDateTimeFormat, JsonValueType) Gets the specified JsonValue as a DateTimeOffset value using the specified format if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to DateTimeOffset; otherwise, returns .
AsDecimal Gets the specified JsonValue as a Decimal value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to Decimal; otherwise, returns .
AsDouble Gets the specified JsonValue as a Double value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to Double; otherwise, returns .
AsEnumTEnum(JsonValue, JsonValueType) Gets the specified JsonValue as TEnum if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to TEnum; otherwise, returns .
AsEnumTEnum(JsonValue, Boolean, JsonValueType) Gets the specified JsonValue as TEnum if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to TEnum; otherwise, returns .
AsEnumTEnum(JsonValue, Boolean, String, JsonValueType) Gets the specified JsonValue as TEnum if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to TEnum; otherwise, returns .
AsGuid Gets the specified JsonValue as a Guid value if Type property of the specified json parameter is String.
AsHalf Gets the specified JsonValue as a Half value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to Half; otherwise, returns .
AsInt128 Gets the specified JsonValue as an Int128 value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to Int128; otherwise, returns .
AsInt16 Gets the specified JsonValue as an Int16 value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to Int16; otherwise, returns .
AsInt32 Gets the specified JsonValue as an Int32 value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to Int32; otherwise, returns .
AsInt64 Gets the specified JsonValue as an Int64 value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to Int64; otherwise, returns .
AsSByte Gets the specified JsonValue as an SByte value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to SByte; otherwise, returns .
AsSingle Gets the specified JsonValue as a Single value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to Single; otherwise, returns .
AsString Gets the specified JsonValue as a String value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to String; otherwise, returns .
AsTimeOnly Gets the specified JsonValue as a TimeOnly value using the specified format if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to TimeOnly; otherwise, returns .
AsTimeSpan Gets the specified JsonValue as a TimeSpan value using the specified format if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to TimeSpan; otherwise, returns .
AsUInt128 Gets the specified JsonValue as an UInt128 value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to UInt128; otherwise, returns .
AsUInt16 Gets the specified JsonValue as an UInt16 value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to UInt16; otherwise, returns .
AsUInt32 Gets the specified JsonValue as an UInt32 value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to UInt32; otherwise, returns .
AsUInt64 Gets the specified JsonValue as an UInt64 value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to UInt64; otherwise, returns .
GetBigIntegerOrDefault(JsonValue, JsonValueType) Gets the specified JsonValue as a BigInteger value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to BigInteger; otherwise, returns 0.
GetBigIntegerOrDefault(JsonValue, BigInteger, JsonValueType) Gets the specified JsonValue as a BigInteger value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to BigInteger; otherwise, returns defaultValue.
GetBooleanOrDefault(JsonValue, JsonValueType) Gets the specified JsonValue as a Boolean value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to Boolean; otherwise, returns , which is the default value of Boolean. This method allows interpreting numeric values as booleans where nonzero values are .
GetBooleanOrDefault(JsonValue, Boolean, JsonValueType) Gets the specified JsonValue as a Boolean value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to Boolean; otherwise, returns defaultValue. This method allows interpreting numeric values as booleans where nonzero values are .
GetByteOrDefault(JsonValue, JsonValueType) Gets the specified JsonValue as a Byte value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to Byte; otherwise, returns 0.
GetByteOrDefault(JsonValue, Byte, JsonValueType) Gets the specified JsonValue as a Byte value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to Byte; otherwise, returns defaultValue.
GetDateOnlyOrDefault(JsonValue, JsonValueType) Gets the specified JsonValue as a DateOnly value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to DateOnly; otherwise, returns DateOnly.MinValue, which is the default value of DateOnly. The actual format is attempted to be auto detected. If you know exact format use the other GetDateOnlyOrDefault overloads.
GetDateOnlyOrDefault(JsonValue, JsonDateTimeFormat, JsonValueType) Gets the specified JsonValue as a DateOnly value using the specified format if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to DateOnly; otherwise, returns DateOnly.MinValue, which is the default value of DateOnly.
GetDateOnlyOrDefault(JsonValue, DateOnly, JsonValueType) Gets the specified JsonValue as a DateOnly value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to DateOnly; otherwise, returns defaultValue. The actual format is attempted to be auto detected. If you know exact format use the other GetDateOnlyOrDefault overloads.
GetDateOnlyOrDefault(JsonValue, String, DateOnly) Gets the specified JsonValue as a DateOnly value using the specified format if Type property of the specified json parameter is String and it can be converted to DateOnly; otherwise, returns defaultValue.
GetDateOnlyOrDefault(JsonValue, JsonDateTimeFormat, DateOnly, JsonValueType) Gets the specified JsonValue as a DateOnly value using the specified format if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to DateOnly; otherwise, returns defaultValue.
GetDateTimeOffsetOrDefault(JsonValue, JsonValueType) Gets the specified JsonValue as a DateTimeOffset value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to DateTimeOffset; otherwise, returns DateTimeOffset.MinValue, which is the default value of DateTimeOffset. The actual format is attempted to be auto detected. If you know exact format use the other GetDateTimeOffsetOrDefault overloads.
GetDateTimeOffsetOrDefault(JsonValue, JsonDateTimeFormat, JsonValueType) Gets the specified JsonValue as a DateTimeOffset value using the specified format if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to DateTimeOffset; otherwise, returns DateTimeOffset.MinValue, which is the default value of DateTimeOffset.
GetDateTimeOffsetOrDefault(JsonValue, DateTimeOffset, JsonValueType) Gets the specified JsonValue as a DateTimeOffset value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to DateTimeOffset; otherwise, returns defaultValue. The actual format is attempted to be auto detected. If you know exact format use the other GetDateTimeOffsetOrDefault overloads.
GetDateTimeOffsetOrDefault(JsonValue, String, DateTimeOffset) Gets the specified JsonValue as a DateTimeOffset value using the specified format if Type property of the specified json parameter is String and it can be converted to DateTimeOffset; otherwise, returns defaultValue.
GetDateTimeOffsetOrDefault(JsonValue, JsonDateTimeFormat, DateTimeOffset, JsonValueType) Gets the specified JsonValue as a DateTimeOffset value using the specified format if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to DateTimeOffset; otherwise, returns defaultValue.
GetDateTimeOrDefault(JsonValue, JsonValueType) Gets the specified JsonValue as a DateTime value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to DateTime; otherwise, returns DateTime.MinValue, which is the default value of DateTime. The actual format is attempted to be auto detected. If you know exact format use the other GetDateTimeOrDefault overloads.
GetDateTimeOrDefault(JsonValue, JsonDateTimeFormat, JsonValueType) Gets the specified JsonValue as a DateTime value using the specified format if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to DateTime; otherwise, returns DateTime.MinValue, which is the default value of DateTime.
GetDateTimeOrDefault(JsonValue, DateTime, JsonValueType) Gets the specified JsonValue as a DateTime value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to DateTime; otherwise, returns defaultValue. The actual format is attempted to be auto detected. If you know exact format use the other GetDateTimeOrDefault overloads.
GetDateTimeOrDefault(JsonValue, NullableDateTimeKind, JsonValueType) Gets the specified JsonValue as a DateTime value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to DateTime; otherwise, returns DateTime.MinValue, which is the default value of DateTime. The actual format is attempted to be auto detected. If you know exact format use the other GetDateTimeOrDefault overloads.
GetDateTimeOrDefault(JsonValue, String, NullableDateTimeKind) Gets the specified JsonValue as a DateTime value using the specified format if Type property of the specified json parameter is String and it can be converted to DateTime; otherwise, returns DateTime.MinValue, which is the default value of DateTime.
GetDateTimeOrDefault(JsonValue, JsonDateTimeFormat, DateTime, JsonValueType) Gets the specified JsonValue as a DateTime value using the specified format if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to DateTime; otherwise, returns defaultValue.
GetDateTimeOrDefault(JsonValue, JsonDateTimeFormat, NullableDateTimeKind, JsonValueType) Gets the specified JsonValue as a DateTime value using the specified format if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to DateTime; otherwise, returns DateTime.MinValue, which is the default value of DateTime.
GetDateTimeOrDefault(JsonValue, DateTime, NullableDateTimeKind, JsonValueType) Gets the specified JsonValue as a DateTime value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to DateTime; otherwise, returns defaultValue. The actual format is attempted to be auto detected. If you know exact format use the other GetDateTimeOrDefault overloads.
GetDateTimeOrDefault(JsonValue, String, DateTime, NullableDateTimeKind) Gets the specified JsonValue as a DateTime value using the specified format if Type property of the specified json parameter is String and it can be converted to DateTime; otherwise, returns defaultValue.
GetDateTimeOrDefault(JsonValue, JsonDateTimeFormat, DateTime, NullableDateTimeKind, JsonValueType) Gets the specified JsonValue as a DateTime value using the specified format if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to DateTime; otherwise, returns defaultValue.
GetDecimalOrDefault(JsonValue, JsonValueType) Gets the specified JsonValue as a Decimal value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to Decimal; otherwise, returns 0.0.
GetDecimalOrDefault(JsonValue, Decimal, JsonValueType) Gets the specified JsonValue as a Decimal value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to Decimal; otherwise, returns defaultValue.
GetDoubleOrDefault(JsonValue, JsonValueType) Gets the specified JsonValue as a Double value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to Double; otherwise, returns 0.0.
GetDoubleOrDefault(JsonValue, Double, JsonValueType) Gets the specified JsonValue as a Double value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to Double; otherwise, returns defaultValue.
GetEnumOrDefaultTEnum(JsonValue, JsonValueType) Gets the specified JsonValue as TEnum if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to TEnum; otherwise, returns the default value of TEnum.
GetEnumOrDefaultTEnum(JsonValue, TEnum, JsonValueType) Gets the specified JsonValue as TEnum if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to TEnum; otherwise, returns defaultValue.
GetEnumOrDefaultTEnum(JsonValue, Boolean, JsonValueType) Gets the specified JsonValue as TEnum if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to TEnum; otherwise, returns the default value of TEnum.
GetEnumOrDefaultTEnum(JsonValue, Boolean, TEnum, JsonValueType) Gets the specified JsonValue as TEnum if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to TEnum; otherwise, returns defaultValue.
GetEnumOrDefaultTEnum(JsonValue, Boolean, String, JsonValueType) Gets the specified JsonValue as TEnum if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to TEnum; otherwise, returns the default value of TEnum.
GetEnumOrDefaultTEnum(JsonValue, Boolean, TEnum, String, JsonValueType) Gets the specified JsonValue as TEnum if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to TEnum; otherwise, returns defaultValue.
GetGuidOrDefault Gets the specified JsonValue as a Guid value if Type property of the specified json parameter is String and it can be converted to Guid; otherwise, returns defaultValue.
GetHalfOrDefault(JsonValue, JsonValueType) Gets the specified JsonValue as a Half value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to Half; otherwise, returns 0.0.
GetHalfOrDefault(JsonValue, Half, JsonValueType) Gets the specified JsonValue as a Half value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to Half; otherwise, returns defaultValue.
GetInt128OrDefault(JsonValue, JsonValueType) Gets the specified JsonValue as an Int128 value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to Int128; otherwise, returns 0.
GetInt128OrDefault(JsonValue, Int128, JsonValueType) Gets the specified JsonValue as an Int128 value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to Int128; otherwise, returns defaultValue.
GetInt16OrDefault(JsonValue, JsonValueType) Gets the specified JsonValue as an Int16 value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to Int16; otherwise, returns 0.
GetInt16OrDefault(JsonValue, Int16, JsonValueType) Gets the specified JsonValue as an Int16 value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to Int16; otherwise, returns defaultValue.
GetInt32OrDefault(JsonValue, JsonValueType) Gets the specified JsonValue as an Int32 value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to Int32; otherwise, returns 0.
GetInt32OrDefault(JsonValue, Int32, JsonValueType) Gets the specified JsonValue as an Int32 value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to Int32; otherwise, returns defaultValue.
GetInt64OrDefault(JsonValue, JsonValueType) Gets the specified JsonValue as an Int64 value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to Int64; otherwise, returns 0.
GetInt64OrDefault(JsonValue, Int64, JsonValueType) Gets the specified JsonValue as an Int64 value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to Int64; otherwise, returns defaultValue.
GetSByteOrDefault(JsonValue, JsonValueType) Gets the specified JsonValue as an SByte value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to SByte; otherwise, returns 0.
GetSByteOrDefault(JsonValue, SByte, JsonValueType) Gets the specified JsonValue as an SByte value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to SByte; otherwise, returns defaultValue.
GetSingleOrDefault(JsonValue, JsonValueType) Gets the specified JsonValue as a Single value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to Single; otherwise, returns 0.0.
GetSingleOrDefault(JsonValue, Single, JsonValueType) Gets the specified JsonValue as a Single value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to Single; otherwise, returns defaultValue.
GetStringOrDefault(JsonValue, JsonValueType) Gets the specified JsonValue as a String value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to String; otherwise, returns .
GetStringOrDefault(JsonValue, String, JsonValueType) Gets the specified JsonValue as a String value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to String; otherwise, returns defaultValue.
GetTimeOnlyOrDefault(JsonValue, JsonValueType) Gets the specified JsonValue as a TimeOnly value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to TimeOnly; otherwise, returns TimeOnly.MinValue, which is the default value of TimeOnly. The actual format is attempted to be auto detected. If you know exact format use the GetTimeOnlyOrDefault(JsonValue, JsonTimeFormat, TimeOnly, JsonValueType) overload instead.
GetTimeOnlyOrDefault(JsonValue, JsonTimeFormat, JsonValueType) Gets the specified JsonValue as a TimeOnly value using the specified format if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to TimeOnly; otherwise, returns TimeOnly.MinValue, which is the default value of TimeOnly.
GetTimeOnlyOrDefault(JsonValue, TimeOnly, JsonValueType) Gets the specified JsonValue as a TimeOnly value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to TimeOnly; otherwise, returns defaultValue. The actual format is attempted to be auto detected. If you know exact format use the GetTimeOnlyOrDefault(JsonValue, JsonTimeFormat, TimeOnly, JsonValueType) overload instead.
GetTimeOnlyOrDefault(JsonValue, JsonTimeFormat, TimeOnly, JsonValueType) Gets the specified JsonValue as a TimeOnly value using the specified format if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to TimeOnly; otherwise, returns defaultValue.
GetTimeSpanOrDefault(JsonValue, JsonValueType) Gets the specified JsonValue as a TimeSpan value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to TimeSpan; otherwise, returns TimeSpan.Zero, which is the default value of TimeSpan. The actual format is attempted to be auto detected. If you know exact format use the GetTimeSpanOrDefault(JsonValue, JsonTimeFormat, TimeSpan, JsonValueType) overload instead.
GetTimeSpanOrDefault(JsonValue, JsonTimeFormat, JsonValueType) Gets the specified JsonValue as a TimeSpan value using the specified format if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to TimeSpan; otherwise, returns TimeSpan.Zero, which is the default value of TimeSpan.
GetTimeSpanOrDefault(JsonValue, TimeSpan, JsonValueType) Gets the specified JsonValue as a TimeSpan value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to TimeSpan; otherwise, returns defaultValue. The actual format is attempted to be auto detected. If you know exact format use the GetTimeSpanOrDefault(JsonValue, JsonTimeFormat, TimeSpan, JsonValueType) overload instead.
GetTimeSpanOrDefault(JsonValue, JsonTimeFormat, TimeSpan, JsonValueType) Gets the specified JsonValue as a TimeSpan value using the specified format if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to TimeSpan; otherwise, returns defaultValue.
GetUInt128OrDefault(JsonValue, JsonValueType) Gets the specified JsonValue as an UInt128 value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to UInt128; otherwise, returns 0.
GetUInt128OrDefault(JsonValue, UInt128, JsonValueType) Gets the specified JsonValue as an UInt128 value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to UInt128; otherwise, returns defaultValue.
GetUInt16OrDefault(JsonValue, JsonValueType) Gets the specified JsonValue as an UInt16 value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to UInt16; otherwise, returns 0.
GetUInt16OrDefault(JsonValue, UInt16, JsonValueType) Gets the specified JsonValue as an UInt16 value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to UInt16; otherwise, returns defaultValue.
GetUInt32OrDefault(JsonValue, JsonValueType) Gets the specified JsonValue as an UInt32 value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to UInt32; otherwise, returns 0.
GetUInt32OrDefault(JsonValue, UInt32, JsonValueType) Gets the specified JsonValue as an UInt32 value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to UInt32; otherwise, returns defaultValue.
GetUInt64OrDefault(JsonValue, JsonValueType) Gets the specified JsonValue as an UInt64 value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to UInt64; otherwise, returns 0.
GetUInt64OrDefault(JsonValue, UInt64, JsonValueType) Gets the specified JsonValue as an UInt64 value if expectedType is Undefined or matches the Type property of the specified json parameter and it can be converted to UInt64; otherwise, returns defaultValue.
ToJson(Boolean) Converts the specified value to JsonValue.
ToJson(Guid) Converts the specified value to JsonValue.
ToJson(NullableBoolean) Converts the specified value to JsonValue.
ToJson(NullableGuid) Converts the specified value to JsonValue.
ToJson(String) Converts the specified value to JsonValue.
ToJson(BigInteger, Boolean) Converts the specified value to JsonValue. To prevent losing precision the default value of the asString parameter is in this overload.
See the Remarks section of the AsNumber property for details.
ToJson(Byte, Boolean) Converts the specified value to JsonValue.
ToJson(DateOnly, String) Converts the specified value to JsonValue.
ToJson(DateTime, String) Converts the specified value to JsonValue.
ToJson(DateTimeOffset, String) Converts the specified value to JsonValue.
ToJson(Decimal, Boolean) Converts the specified value to JsonValue. To prevent losing precision the default value of the asString parameter is in this overload.
See the Remarks section of the AsNumber property for details.
ToJson(Double, Boolean) Converts the specified value to JsonValue.
ToJson(Half, Boolean) Converts the specified value to JsonValue.
ToJson(Int128, Boolean) Converts the specified value to JsonValue. To prevent losing precision the default value of the asString parameter is in this overload.
See the Remarks section of the AsNumber property for details.
ToJson(Int16, Boolean) Converts the specified value to JsonValue.
ToJson(Int32, Boolean) Converts the specified value to JsonValue.
ToJson(Int64, Boolean) Converts the specified value to JsonValue. To prevent losing precision the default value of the asString parameter is in this overload.
See the Remarks section of the AsNumber property for details.
ToJson(NullableByte, Boolean) Converts the specified value to JsonValue.
ToJson(NullableDateOnly, String) Converts the specified value to JsonValue.
ToJson(NullableDateTime, String) Converts the specified value to JsonValue.
ToJson(NullableDateTimeOffset, String) Converts the specified value to JsonValue.
ToJson(NullableDecimal, Boolean) Converts the specified value to JsonValue. To prevent losing precision the default value of the asString parameter is in this overload.
See the Remarks section of the AsNumber property for details.
ToJson(NullableDouble, Boolean) Converts the specified value to JsonValue.
ToJson(NullableHalf, Boolean) Converts the specified value to JsonValue.
ToJson(NullableInt128, Boolean) Converts the specified value to JsonValue. To prevent losing precision the default value of the asString parameter is in this overload.
See the Remarks section of the AsNumber property for details.
ToJson(NullableInt16, Boolean) Converts the specified value to JsonValue.
ToJson(NullableInt32, Boolean) Converts the specified value to JsonValue.
ToJson(NullableInt64, Boolean) Converts the specified value to JsonValue. To prevent losing precision the default value of the asString parameter is in this overload.
See the Remarks section of the AsNumber property for details.
ToJson(NullableBigInteger, Boolean) Converts the specified value to JsonValue. To prevent losing precision the default value of the asString parameter is in this overload.
See the Remarks section of the AsNumber property for details.
ToJson(NullableSByte, Boolean) Converts the specified value to JsonValue.
ToJson(NullableSingle, Boolean) Converts the specified value to JsonValue.
ToJson(NullableUInt128, Boolean) Converts the specified value to JsonValue. To prevent losing precision the default value of the asString parameter is in this overload.
See the Remarks section of the AsNumber property for details.
ToJson(NullableUInt16, Boolean) Converts the specified value to JsonValue.
ToJson(NullableUInt32, Boolean) Converts the specified value to JsonValue.
ToJson(NullableUInt64, Boolean) Converts the specified value to JsonValue. To prevent losing precision the default value of the asString parameter is in this overload.
See the Remarks section of the AsNumber property for details.
ToJson(SByte, Boolean) Converts the specified value to JsonValue.
ToJson(Single, Boolean) Converts the specified value to JsonValue.
ToJson(UInt128, Boolean) Converts the specified value to JsonValue. To prevent losing precision the default value of the asString parameter is in this overload.
See the Remarks section of the AsNumber property for details.
ToJson(UInt16, Boolean) Converts the specified value to JsonValue.
ToJson(UInt32, Boolean) Converts the specified value to JsonValue.
ToJson(UInt64, Boolean) Converts the specified value to JsonValue. To prevent losing precision the default value of the asString parameter is in this overload.
See the Remarks section of the AsNumber property for details.
ToJson(DateOnly, JsonDateTimeFormat, Boolean) Converts the specified value to JsonValue.
ToJson(DateTime, JsonDateTimeFormat, Boolean) Converts the specified value to JsonValue.
ToJson(DateTimeOffset, JsonDateTimeFormat, Boolean) Converts the specified value to JsonValue.
ToJson(NullableDateOnly, JsonDateTimeFormat, Boolean) Converts the specified value to JsonValue.
ToJson(NullableDateTime, JsonDateTimeFormat, Boolean) Converts the specified value to JsonValue.
ToJson(NullableDateTimeOffset, JsonDateTimeFormat, Boolean) Converts the specified value to JsonValue.
ToJson(NullableTimeOnly, JsonTimeFormat, Boolean) Converts the specified value to JsonValue.
ToJson(NullableTimeSpan, JsonTimeFormat, Boolean) Converts the specified value to JsonValue.
ToJson(TimeOnly, JsonTimeFormat, Boolean) Converts the specified value to JsonValue.
ToJson(TimeSpan, JsonTimeFormat, Boolean) Converts the specified value to JsonValue.
ToJsonTEnum(NullableTEnum, JsonEnumFormat, String) Converts the specified value to JsonValue.
ToJsonTEnum(TEnum, JsonEnumFormat, String) Converts the specified value to JsonValue.
TryGetBigInteger Tries to get the specified JsonValue as a BigInteger value if expectedType is Undefined or matches the Type property of the specified json parameter.
TryGetBoolean Tries to get the specified JsonValue as a Boolean value if expectedType is Undefined or matches the Type property of the specified json parameter. This method allows interpreting numeric values as booleans where nonzero values are .
TryGetByte Tries to get the specified JsonValue as a Byte value if expectedType is Undefined or matches the Type property of the specified json parameter.
TryGetDateOnly(JsonValue, DateOnly, JsonValueType) Tries to get the specified JsonValue as a DateOnly value if expectedType is Undefined or matches the Type property of the specified json parameter. The actual format is attempted to be auto detected. If you know exact format use the other TryGetDateOnly overloads.
TryGetDateOnly(JsonValue, String, DateOnly) Tries to get the specified JsonValue as a DateOnly value using the specified format if Type property of the specified json parameter is String.
TryGetDateOnly(JsonValue, JsonDateTimeFormat, DateOnly, JsonValueType) Tries to get the specified JsonValue as a DateOnly value using the specified format if expectedType is Undefined or matches the Type property of the specified json parameter.
TryGetDateTime(JsonValue, DateTime, JsonValueType) Tries to get the specified JsonValue as a DateTime value if expectedType is Undefined or matches the Type property of the specified json parameter. The actual format is attempted to be auto detected. If you know exact format use the other TryGetDateTime overloads.
TryGetDateTime(JsonValue, JsonDateTimeFormat, DateTime, JsonValueType) Tries to get the specified JsonValue as a DateTime value using the specified format if expectedType is Undefined or matches the Type property of the specified json parameter.
TryGetDateTime(JsonValue, DateTime, NullableDateTimeKind, JsonValueType) Tries to get the specified JsonValue as a DateTime value if expectedType is Undefined or matches the Type property of the specified json parameter. The actual format is attempted to be auto detected. If you know exact format use the other TryGetDateTime overloads.
TryGetDateTime(JsonValue, String, DateTime, NullableDateTimeKind) Tries to get the specified JsonValue as a DateTime value using the specified format if Type property of the specified json parameter is String.
TryGetDateTime(JsonValue, JsonDateTimeFormat, DateTime, NullableDateTimeKind, JsonValueType) Tries to get the specified JsonValue as a DateTime value using the specified format if expectedType is Undefined or matches the Type property of the specified json parameter.
TryGetDateTimeOffset(JsonValue, DateTimeOffset, JsonValueType) Tries to get the specified JsonValue as a DateTimeOffset value if expectedType is Undefined or matches the Type property of the specified json parameter. The actual format is attempted to be auto detected. If you know exact format use the other TryGetDateTimeOffset overloads.
TryGetDateTimeOffset(JsonValue, String, DateTimeOffset) Tries to get the specified JsonValue as a DateTimeOffset value using the specified format if Type property of the specified json parameter is String.
TryGetDateTimeOffset(JsonValue, JsonDateTimeFormat, DateTimeOffset, JsonValueType) Tries to get the specified JsonValue as a DateTimeOffset value using the specified format if expectedType is Undefined or matches the Type property of the specified json parameter.
TryGetDecimal Tries to get the specified JsonValue as a Decimal value if expectedType is Undefined or matches the Type property of the specified json parameter.
TryGetDouble Tries to get the specified JsonValue as a Double value if expectedType is Undefined or matches the Type property of the specified json parameter.
TryGetEnumTEnum(JsonValue, TEnum, JsonValueType) Tries to get the specified JsonValue as a TEnum value if expectedType is Undefined or matches the Type property of the specified json parameter.
TryGetEnumTEnum(JsonValue, Boolean, TEnum, JsonValueType) Tries to get the specified JsonValue as TEnum if expectedType is Undefined or matches the Type property of the specified json parameter.
TryGetEnumTEnum(JsonValue, Boolean, TEnum, String, JsonValueType) Tries to get the specified JsonValue as TEnum if expectedType is Undefined or matches the Type property of the specified json parameter.
TryGetGuid Tries to get the specified JsonValue as a Guid value if Type property of the specified json parameter is String.
TryGetHalf Tries to get the specified JsonValue as a Half value if expectedType is Undefined or matches the Type property of the specified json parameter.
TryGetInt128 Tries to get the specified JsonValue as an Int128 value if expectedType is Undefined or matches the Type property of the specified json parameter.
TryGetInt16 Tries to get the specified JsonValue as an Int16 value if expectedType is Undefined or matches the Type property of the specified json parameter.
TryGetInt32 Tries to get the specified JsonValue as an Int32 value if expectedType is Undefined or matches the Type property of the specified json parameter.
TryGetInt64 Tries to get the specified JsonValue as an Int64 value if expectedType is Undefined or matches the Type property of the specified json parameter.
TryGetSByte Tries to get the specified JsonValue as an SByte value if expectedType is Undefined or matches the Type property of the specified json parameter.
TryGetSingle Tries to get the specified JsonValue as a Single value if expectedType is Undefined or matches the Type property of the specified json parameter.
TryGetString Tries to get the specified JsonValue as a String value if expectedType is Undefined or matches the Type property of the specified json parameter.
TryGetTimeOnly(JsonValue, TimeOnly, JsonValueType) Tries to get the specified JsonValue as a TimeOnly value if expectedType is Undefined or matches the Type property of the specified json parameter. The actual format is attempted to be auto detected. If you know exact format use the TryGetTimeOnly(JsonValue, JsonTimeFormat, TimeOnly, JsonValueType) overload instead.
TryGetTimeOnly(JsonValue, JsonTimeFormat, TimeOnly, JsonValueType) Tries to get the specified JsonValue as a TimeOnly value using the specified format if expectedType is Undefined or matches the Type property of the specified json parameter.
TryGetTimeSpan(JsonValue, TimeSpan, JsonValueType) Tries to get the specified JsonValue as a TimeSpan value if expectedType is Undefined or matches the Type property of the specified json parameter. The actual format is attempted to be auto detected. If you know exact format use the TryGetTimeSpan(JsonValue, JsonTimeFormat, TimeSpan, JsonValueType) overload instead.
TryGetTimeSpan(JsonValue, JsonTimeFormat, TimeSpan, JsonValueType) Tries to get the specified JsonValue as a TimeSpan value using the specified format if expectedType is Undefined or matches the Type property of the specified json parameter.
TryGetUInt128 Tries to get the specified JsonValue as an UInt128 value if expectedType is Undefined or matches the Type property of the specified json parameter.
TryGetUInt16 Tries to get the specified JsonValue as an UInt16 value if expectedType is Undefined or matches the Type property of the specified json parameter.
TryGetUInt32 Tries to get the specified JsonValue as an UInt32 value if expectedType is Undefined or matches the Type property of the specified json parameter.
TryGetUInt64 Tries to get the specified JsonValue as an UInt64 value if expectedType is Undefined or matches the Type property of the specified json parameter.

See Also