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

MongoDB.Bson.Serialization.Serializers.DictionarySerializer do not support empty string as key.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 1.6.1, 1.7
    • Fix Version/s: 1.8
    • Component/s: None
    • Labels:
      None

      Description

      In C# it is ok create the following code:

      var dic = new Dictionary<string,int> {

      {"", 1}

      , {"test", 2}};

      but this dictionary can't get serialized when it has an empty string as key.

      See: https://github.com/mongodb/mongo-csharp-driver/blob/master/Bson/Serialization/Serializers/DictionarySerializer.cs#L178

        Attachments

          Activity

            People

            Assignee:
            rstam Robert Stam
            Reporter:
            mbertelsen Michael Bertelsen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: