System\Text\Json\Nodes\JsonValueOfT.cs (22)
18Debug.Assert(value is not JsonElement or JsonElement { ValueKind: not JsonValueKind.Null });
58private static readonly JsonValueKind? s_valueKind = DetermineValueKindForType(typeof(TValue));
63private protected static JsonValueKind DetermineValueKind(TValue value)
70return boolean ? JsonValueKind.True : JsonValueKind.False;
79private static JsonValueKind? DetermineValueKindForType(Type type)
98return JsonValueKind.String;
104return JsonValueKind.Number;
109TypeCode.Boolean => JsonValueKind.Undefined, // Can vary dependending on value.
110TypeCode.SByte => JsonValueKind.Number,
111TypeCode.Byte => JsonValueKind.Number,
112TypeCode.Int16 => JsonValueKind.Number,
113TypeCode.UInt16 => JsonValueKind.Number,
114TypeCode.Int32 => JsonValueKind.Number,
115TypeCode.UInt32 => JsonValueKind.Number,
116TypeCode.Int64 => JsonValueKind.Number,
117TypeCode.UInt64 => JsonValueKind.Number,
118TypeCode.Single => JsonValueKind.Number,
119TypeCode.Double => JsonValueKind.Number,
120TypeCode.Decimal => JsonValueKind.Number,
121TypeCode.String => JsonValueKind.String,
122TypeCode.Char => JsonValueKind.String,