public static void CloneEntity(DataResult sourceObj, Saas.Tools.FlowWFService.DataResult targetObj) { Type a = sourceObj.GetType(); PropertyInfo[] infos = a.GetProperties(); foreach (PropertyInfo prop in infos) { //prop.Name object value = prop.GetValue(sourceObj, null); try { prop.SetValue(targetObj, value, null); } catch (Exception ex) { string e = ex.Message; } } }
public static void CloneEntity(DataResult sourceObj, Saas.Tools.FlowWFService.DataResult targetObj) { Type a = sourceObj.GetType(); PropertyInfo[] infos = a.GetProperties(); foreach (PropertyInfo prop in infos) { //prop.Name object value = prop.GetValue(sourceObj, null); try { prop.SetValue(targetObj, value, null); } catch (Exception ex) { string e = ex.Message; } } }