/// <summary> /// 拷贝赋值子类 /// </summary> /// <param name="list"></param> /// <returns></returns> private static List<JHCDR_LAB_REPORT_Vo> AutoCopy(List<JHCDR_LAB_REPORT> list) { if(list==null) { return new List<JHCDR_LAB_REPORT_Vo>(); } List<JHCDR_LAB_REPORT_Vo> listVo = new List<JHCDR_LAB_REPORT_Vo>(); foreach(var p in list) { JHCDR_LAB_REPORT_Vo data = new JHCDR_LAB_REPORT_Vo(); var ParentType = typeof(JHCDR_LAB_REPORT); //获取公共属性 var Properties = ParentType.GetProperties(); foreach (var Propertie in Properties) { if (Propertie.CanRead && Propertie.CanWrite) { Propertie.SetValue(data, Propertie.GetValue(p, null), null); } } listVo.Add(data); } return listVo; }