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

ImmutableTypeClassMapConvention is ignoring some constructors

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.11.3
    • Fix Version/s: 2.12.0
    • Component/s: Serialization
    • Labels:
      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

              Assignee:
              rstam Robert Stam
              Reporter:
              rstam Robert Stam
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: