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

ImmutableTypeClassMapConvention is ignoring some constructors

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 2.12.0
    • 2.11.3
    • Serialization
    • None

    Description

      ImmutableTypeClassMapConvention is ignoring any constructor that doesn't have exactly as many parameters as the class has properties.

      This is not correct. All constructors should be considered.

      The problem is this line of code:

      https://github.com/mongodb/mongo-csharp-driver/blob/v2.11.3/src/MongoDB.Bson/Serialization/Conventions/ImmutableTypeClassMapConvention.cs#L55

      The if statement and the continue statement should just be removed.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: