/// <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 (ProductCategoryID != null) { hashCode = hashCode * 59 + ProductCategoryID.GetHashCode(); } if (Name != null) { hashCode = hashCode * 59 + Name.GetHashCode(); } return(hashCode); } }
/// <summary> /// Returns true if ProductCategory instances are equal /// </summary> /// <param name="other">Instance of ProductCategory to be compared</param> /// <returns>Boolean</returns> public bool Equals(ProductCategory other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( ProductCategoryID == other.ProductCategoryID || ProductCategoryID != null && ProductCategoryID.Equals(other.ProductCategoryID) ) && ( Name == other.Name || Name != null && Name.Equals(other.Name) )); }