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
There are a number of tools that do this. Look at the "TranslateTo" routine in service stack as an example. They have excellent auto mapping (https://github.com/ServiceStack/ServiceStack/wiki/Auto-mapping).
Using this, all you would have to do is:
obj2 = obj1.TranslateTo();
Simple and elegant!
In case you are interested a few other references to similar topics: