title: Why is the original object changed after a copy, without using ref arguments?
body: <p>At work we were encountering a problem where the original object was changed after we send a copy through a method. We did find a workaround by using <code>IClonable</code> in the original class, but as we couldn't find out why it happened in the first place. </p>
  
  <p>We wrote this example code to reproduce the problem (which resembles our original code), and hope someone is able to explain why it happens.</p>
  
  <pre><code>public partial class ClassRefTest : System.Web.UI.Page
  {
      protected void Page_Load(object sender, EventArgs e)
      {
          var myclass = new MyClass();
          var copy = myclass;
          myclass.Mystring = "jadajadajada";
          Dal.DoSomeThing(copy);
  
          lit.Text = myclass.Mystring; //Text is expected to be jadajadajada, 
                                         but ends up to be referenced
      }
  }
  
  public class MyClass
  {
      public string Mystring { get; set; } 
  }
  
  public static class Dal
  {
      public static int? DoSomeThing(MyClass daclass)
      {
          daclass.Mystring = "referenced";
          return null;
      }
  
  }
  </code></pre>
  
  <p>As you can see, in the <code>DoSomething()</code> method we're not using any <code>ref</code> argument, but still the <code>lit.Text</code> ends up to be referenced.</p>
  
  <p>Why does this happen?</p>