public override int GetHashCode() { //Get hash code for the Name field if it is not null. int hashProductName = Filtertype.GetHashCode(); //Get hash code for the Code field. int hashProductCode = FilterValues.GetHashCode(); //Calculate the hash code for the product. return(hashProductName ^ hashProductCode); }