/// <summary> /// 对象对比 /// </summary> /// <param name="left"></param> /// <param name="right"></param> /// <param name="memberMap"></param> /// <returns></returns> private bool equalsValue(valueType left, valueType right, memberMap memberMap) { object leftObject = left, rightObject = right; foreach (field field in fields) { if (memberMap.UnsafeIsMember(field.MemberIndex) && !field.Equals(field.Field.GetValue(leftObject), field.Field.GetValue(rightObject))) { return(false); } } return(true); }
/// <summary> /// 对象对比 /// </summary> /// <param name="left"></param> /// <param name="right"></param> /// <param name="memberMap"></param> /// <returns></returns> private bool equals(valueType left, valueType right, memberMap memberMap) { if (object.ReferenceEquals(left, right)) { return(true); } foreach (field field in fields) { if (memberMap.UnsafeIsMember(field.MemberIndex) && !field.Equals(field.Field.GetValue(left), field.Field.GetValue(right))) { return(false); } } return(true); }