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

NamedIdMemberConvention should do nothing if base class already has an _id

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • None
    • 1.10, 2.0
    • Serialization

    Description

      Serializing the following classes fails because NamedIdMemberConvention doesn't realize that C already has an _id, and tries to map the Id in D to "_id" also, resulting in duplicate element names.

      public class C
      {
          public int _id { get; set; }
      }
       
      public class D : C
      {
          public int Id { get; set; }
      }
      

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: