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

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

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.8
    • Affects Version/s: 1.6.1, 1.7
    • Component/s: None
    • None

      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

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            mbertelsen Michael Bertelsen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: