Skip to content

Commit

Permalink
Add DateTimeOffset to the known types for `ObjectToInferredTypesCon…
Browse files Browse the repository at this point in the history
…verter`
  • Loading branch information
flobernd committed Oct 11, 2024
1 parent b71d97a commit ff2a56b
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ public override object Read(
{
JsonTokenType.True => true,
JsonTokenType.False => false,
JsonTokenType.Number when reader.TryGetInt64(out var l) => l,
JsonTokenType.Number when reader.TryGetInt64(out var value) => value,
JsonTokenType.Number => reader.GetDouble(),
JsonTokenType.String when reader.TryGetDateTime(out var datetime) => datetime,
JsonTokenType.String => reader.GetString(),
JsonTokenType.String when reader.TryGetDateTime(out var value) => value,
JsonTokenType.String when reader.TryGetDateTimeOffset(out var value) => value,
JsonTokenType.String => reader.GetString()!,
_ => JsonDocument.ParseValue(ref reader).RootElement.Clone()
};

Expand Down

0 comments on commit ff2a56b

Please sign in to comment.