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

ImmutableTypeClassMapConvention is ignoring some constructors

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.12.0
    • Affects Version/s: 2.11.3
    • Component/s: Serialization
    • None

      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.

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

              Created:
              Updated:
              Resolved: