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

ImmutableTypeClassMapConvention is ignoring some constructors

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 2.11.3
    • 2.12.0
    • 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

        Issue Links

          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: