摘要:
工作中用到对同一个类型的对象的赋值,需要逐个属性的赋值赋过去,在网上找了很久没发觉合适的,就自己动手写了个,以做备忘用。 protectedvoidAutoAssign(objectfrom,objectto){foreach(variteminfrom.GetType().GetProperties()){item.SetValue(to,item.GetValue(from,null),null);}} 阅读全文
posted @ 2013-09-04 19:29
番茄的梦想
阅读(930)
评论(0)
推荐(1)
浙公网安备 33010602011771号