In order to copy an object to a new one and avoiding assigning every member to it equivalent value, you can use this to loop dynamically over every property inside the object and return the value in order to assign it to the new instance
public static Employee CopyEmployee(Employee empToCopyFrom)
{
Employee newEmp = new Employee();
foreach (System.Reflection.PropertyInfo propInfo in typeof(Employee).GetProperties())
{
object valueToCopy = propInfo.GetValue(empToCopyFrom, null);
propInfo.SetValue(newEmp, valueToCopy, null);
}
return newEmp;
}
Hope this helped
Enjoy !