title: How to automatically map the values between instances of two different classes if both have same properties?
body: <p>I have two classes with exactly same members (properties and fields) with same datatypes. I want to map the members from one to other in automated way. I know there are more practical means development-wise to handle. One simple solution is to manually map each member from one instance to other. But, I want to automate this as some general solution.</p>
  
  <p>Assuming you have the following code:</p>
  
  <pre><code>public MyObject1 AssignTest (MyObject1 obj1, MyObject2 obj2)
  {
      //Code here for auto map
  }
  </code></pre>
  
  <p>Where <code>MyObject1</code> and <code>MyObject2</code> have the <em>exact</em> same properties with same datatype. I do not want to go through and assign the values individually (i.e. <code>MyObject1.Property1 = MyObject2.Property1</code> etc.). Is it possible to assign all the values that have been specified in <code>MyObject1</code> to <code>MyObject2</code> automatically?</p>