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

Constructor argument with same name as property but different types fails to serialize

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Serialization
    • Labels:
      None

      Description

       

      public class A
       {
        public int[] Data { get; }
        public A(IEnumerable<int> data)
        {
          Data = data.ToArray();
        }
       }
       
       
      public class B
      {
        public int[] Data { get; }
        public B(IEnumerable<int> data2)
        {
          Data = data2.ToArray();
        }
      }
      

      A.ToBson() fails while B.ToBson() works.
      Consider same type and name matching in both ImmutableTypeClassMapConvention and NamedParameterCreatorMapConvention

       

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            boris.dogadov Boris Dogadov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: