/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (ProductPhotoID != null) { hashCode = hashCode * 59 + ProductPhotoID.GetHashCode(); } if (ThumbNailPhoto != null) { hashCode = hashCode * 59 + ThumbNailPhoto.GetHashCode(); } if (ThumbNailPhotoFileName != null) { hashCode = hashCode * 59 + ThumbNailPhotoFileName.GetHashCode(); } if (LargePhoto != null) { hashCode = hashCode * 59 + LargePhoto.GetHashCode(); } if (LargePhotoFileName != null) { hashCode = hashCode * 59 + LargePhotoFileName.GetHashCode(); } return(hashCode); } }
/// <summary> /// Returns true if ProductPhoto instances are equal /// </summary> /// <param name="other">Instance of ProductPhoto to be compared</param> /// <returns>Boolean</returns> public bool Equals(ProductPhoto other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( ProductPhotoID == other.ProductPhotoID || ProductPhotoID != null && ProductPhotoID.Equals(other.ProductPhotoID) ) && ( ThumbNailPhoto == other.ThumbNailPhoto || ThumbNailPhoto != null && ThumbNailPhoto.Equals(other.ThumbNailPhoto) ) && ( ThumbNailPhotoFileName == other.ThumbNailPhotoFileName || ThumbNailPhotoFileName != null && ThumbNailPhotoFileName.Equals(other.ThumbNailPhotoFileName) ) && ( LargePhoto == other.LargePhoto || LargePhoto != null && LargePhoto.Equals(other.LargePhoto) ) && ( LargePhotoFileName == other.LargePhotoFileName || LargePhotoFileName != null && LargePhotoFileName.Equals(other.LargePhotoFileName) )); }