Class map automapping should support immutable classes with readonly automatic properties

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.4.1
    • Affects Version/s: 2.3
    • Component/s: Serialization
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Class map automapping does not map the following class correctly:

      public class ClassWithReadOnlyProperty
      {
          public ClassWithReadOnlyProperty(int x)
          {
              X = x;
          }
      
          public int X { get; }
      }
      

      Note that this is slightly different from properties with private setters, which are already supported:

      public class ClassWithPrivateSetter
      {
          public ClassWithPrivateSetter(int x)
          {
              X = x;
          }
      
          public int X { get; private set; }
      }
      

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

                Created:
                Updated:
                Resolved: