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

[Question] Serialization result of DBNull.Value should be empty object({})? #1014

Open
filzrev opened this issue Dec 1, 2024 · 0 comments
Open

Comments

@filzrev
Copy link
Contributor

filzrev commented Dec 1, 2024

Currently, DBNull.Value is serialized to empty object string({}).

There is dedicated code path for DBNull.Value on FullObjectGraphTraversalStrategy.
But it seems not be used. (Because value.IsDbNull() always returns false, And ther is no break statement)

if (value.IsDbNull())
{
visitor.VisitScalar(new ObjectDescriptor(null, typeof(object), typeof(object)), context, serializer);
}

Is this current behavior is working as expected?

Note

Returning empty object is same behavior as System.Text,Json. (https://github.com/dotnet/runtime/issues/418)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant