title: How to make a copy of an object in C#
body: <p>Let's say that I have a class:</p>
  
  <pre><code>class obj
  {
    int a;
    int b;
  }
  </code></pre>
  
  <p>and then I have this code:</p>
  
  <pre><code>obj myobj = new obj(){ a=1, b=2}
  obj myobj2 = myobj;
  </code></pre>
  
  <p>Now the above code makes a reference to the first obj. What I want is that <code>myobj2</code> refers to a copy of the <code>myobj</code> with changes not being reflected in the original. I have searched SO and the solutions thus far seems complicated. Is there an easier way to do this. I am using .net 4.5</p>