Skip to content

Override BinaryData serialization in JsonObjectSerializer#18978

Merged
JoshLove-msft merged 2 commits intoAzure:masterfrom
JoshLove-msft:json-bd
Feb 24, 2021
Merged

Override BinaryData serialization in JsonObjectSerializer#18978
JoshLove-msft merged 2 commits intoAzure:masterfrom
JoshLove-msft:json-bd

Conversation

@JoshLove-msft
Copy link
Member

Resolves #18931


private BinaryData SerializeToBinaryDataInternal(object? value, Type? inputType)
{
byte[] bytes = JsonSerializer.SerializeToUtf8Bytes(value, inputType ?? value?.GetType() ?? typeof(object), _options);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The jsonSerializable ctor of BinaryData actually does this, but it seems better to be explicit here in terms of the serializer being used.

@JoshLove-msft JoshLove-msft enabled auto-merge (squash) February 24, 2021 22:29
@JoshLove-msft JoshLove-msft merged commit 7d9758c into Azure:master Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement BinaryData Serialize overload in JsonObjectSerializer

2 participants