Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-3023

ValueType properties should be deserializable from null if supported by their serializer

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Serialization
    • Labels:
      None

      Description

      Per the contributor PR description:

      Currently, if a struct/ValueType has its own converter registered it can be deserialized from null. However if the same struct/ValueType is property (or field) of a class, deserialization fails. Given that there is no test failing if I change that behaviour, I assume that it is a bug. Nevertheless, given example below, I think it makes sense to support it anyway.

      https://github.com/mongodb/mongo-csharp-driver/pull/395

        Attachments

          Activity

            People

            Assignee:
            rstam Robert Stam
            Reporter:
            vincent.kam Vincent Kam (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: