title: How to prevent property setter from modifying private property data
body: <p>Let me explain my question by posing a hypothetical situation. Lets start with a class:</p>
  
  <pre><code>public class PaymentDetails
  {
      public int Id {get;set;}
      public string Status {get;set;}
  }
  </code></pre>
  
  <p>And then I have another class:</p>
  
  <pre><code>public class PaymentHelper
  {
      private PaymentDetails _paymentDetails;
      public PaymentDetails MyPaymentDetails{ get { return _paymentDetails; } }
  
      public PaymentHelper()
      {
          _paymentDetails = new PaymentDetails(); 
      }
  
      public void ModifyPaymentDetails(string someString)
      {
          // code to take the arguments and modify this._paymentDetails
      }
  }
  </code></pre>
  
  <p>OK, so I have these two classes. <code>PaymentHelper</code> has made the property <code>MyPaymentDetails</code> read-only.</p>
  
  <p>So I cannot instantiate <code>PaymentHelper</code> and modify <code>MyPaymentDetails</code> like this:</p>
  
  <pre><code>PaymentHelper ph = new PaymentHelper();
  ph.MyPaymentDetails = new PaymentDetails(); // Not allowed!!! 
  </code></pre>
  
  <p>But I can modify the public properties inside of <code>ph.MyPaymentDetails</code> like this:</p>
  
  <pre><code>ph.MyPaymentDetails.Status = "Some status"; // This is allowed
  </code></pre>
  
  <p>How do I prevent that from working? Or is there no good way of doing that?</p>