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

[BsonRepresentation(BsonType.String)] does not work as expected when decorating Guids

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 1.0
    • 0.9
    • None
    • None
    • Windows

    Description

      If I have an object with a property:

      [BsonRepresentation(BsonType.String)]
      public Guid photoId

      { get; set; }

      Callign ToJson() on an that object leads to the folling being generated:
      "photoId": "{}"

      Attachments

        Activity

          People

            robert@mongodb.com Robert Stam
            zippy1981 Justin Dearing
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: