title: .NET: Is there a Class to copy properties of one class to another
body: <p>I wrote a function that copies the properties of one class to another so make a copy of an object.</p>
  
  <p>So something like</p>
  
  <pre><code>MyObject myObject = myOtherObject.MyCustomCopy(myObject)
  </code></pre>
  
  <p>where myObject and myOtherObject are of the same type. I do it by bascually doing</p>
  
  <pre><code>myObject.prop1 = myOtherObject.prop1
  myObject.prop2 = myOtherObject.prop2
  myObject.prop3 = myOtherObject.prop3
  return myObject
  </code></pre>
  
  <p>I am pretty sure in the past I used a .NET object that automaticaly did this, by reflection I guess, but can't remember it ... or an I imagining that such a method exists?</p>
  
  <p>Yes I'm aware of auto mapper but i was sure (not so much now) that there is a .NET object that does the job. Maybe not!</p>