YamlDotNet
YamlDotNet copied to clipboard
[Question] Serialization result of `DBNull.Value` should be empty object(`{}`)?
trafficstars
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)
https://github.com/aaubry/YamlDotNet/blob/7bed5cf0750c7ca58ba69ad8c07f6eb136080540/YamlDotNet/Serialization/ObjectGraphTraversalStrategies/FullObjectGraphTraversalStrategy.cs#L141-L144
Is this current behavior is working as expected?
[!NOTE] Returning
empty objectis same behavior asSystem.Text,Json. (https://github.com/dotnet/runtime/issues/418)