AzureCoreExtensions
Extensions that can be used for serialization.
Return the content of the BinaryData as a dynamic type. Please see https://aka.ms/azsdk/net/dynamiccontent for details.
public static object ToDynamicFromJson(this BinaryData utf8Json, JsonPropertyNames propertyNameFormat, string dateTimeFormat = "o")
Return the content of the BinaryData as a dynamic type. Please see https://aka.ms/azsdk/net/dynamiccontent for details.
propertyNameFormatThe format of property names in the JSON content.
This value indicates to the dynamic type that it can convert property names on the returned value to this format in the underlying JSON.
Please see https://aka.ms/azsdk/net/dynamiccontent#use-c-naming-conventions for details.
dateTimeFormatThe standard format specifier to pass when serializing DateTime and DateTimeOffset values in the JSON content.
To serialize to unix time, pass the value "x" and
see https://learn.microsoft.com/dotnet/standard/base-types/standard-date-and-time-format-strings#table-of-format-specifiers for other well known values.
public static T ToObject<T>(this BinaryData data, ObjectSerializer serializer, CancellationToken cancellationToken = default)
Converts the BinaryData to the specified type using
the provided ObjectSerializer.
public static ValueTask<T> ToObjectAsync<T>(this BinaryData data, ObjectSerializer serializer, CancellationToken cancellationToken = default)
Converts the BinaryData to the specified type using
the provided ObjectSerializer.
Converts the json value represented by BinaryData to an object of a specific type.