var beCopiedObj = obj;
var toSetObj = newObj;
foreach (var item in beCopiedObj.GetType().GetProperties())
{
var pro = toSetObj.GetType().GetProperty(item.Name);
if (pro != null)
{
pro.SetValue(toSetObj, item.GetValue(beCopiedObj, null), null);
}
}
var toSetObj = newObj;
foreach (var item in beCopiedObj.GetType().GetProperties())
{
var pro = toSetObj.GetType().GetProperty(item.Name);
if (pro != null)
{
pro.SetValue(toSetObj, item.GetValue(beCopiedObj, null), null);
}
}