Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Set(object) API from MutableJsonElement #38266

Merged
merged 15 commits into from
Aug 22, 2023
9 changes: 3 additions & 6 deletions sdk/core/Azure.Core/src/DynamicData/MutableJsonElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,7 @@ public bool TryGetDateTime(out DateTime value)
return true;
case DateTimeOffset:
case string:
SerializeToJsonElement(change.Value, _root.SerializerOptions).TryGetDateTime(out value);
return true;
return SerializeToJsonElement(change.Value, _root.SerializerOptions).TryGetDateTime(out value);
annelo-msft marked this conversation as resolved.
Show resolved Hide resolved
case JsonElement element:
return element.TryGetDateTime(out value);
case null:
Expand Down Expand Up @@ -530,8 +529,7 @@ public bool TryGetDateTimeOffset(out DateTimeOffset value)
return true;
case DateTime:
case string:
SerializeToJsonElement(change.Value, _root.SerializerOptions).TryGetDateTimeOffset(out value);
return true;
return SerializeToJsonElement(change.Value, _root.SerializerOptions).TryGetDateTimeOffset(out value);
case JsonElement element:
return element.TryGetDateTimeOffset(out value);
case null:
Expand Down Expand Up @@ -606,8 +604,7 @@ public bool TryGetGuid(out Guid value)
value = g;
return true;
case string:
SerializeToJsonElement(change.Value, _root.SerializerOptions).TryGetGuid(out value);
return true;
return SerializeToJsonElement(change.Value, _root.SerializerOptions).TryGetGuid(out value);
case JsonElement element:
return element.TryGetGuid(out value);
case null:
Expand Down