Esempio n. 1
0
        // If Equals() returns true for a pair of objects
        // then GetHashCode() must return the same value for these objects.

        public override int GetHashCode()
        {
            //Get hash code for the modelo field if it is not null.
            int hashMarca = BrandDescription == null ? 0 : BrandDescription.GetHashCode();

            //Get hash code for the modelo field if it is not null.
            int hashModelo = ModelDescription == null ? 0 : ModelDescription.GetHashCode();

            //Calculate the hash code for the product.
            return(hashMarca ^ hashModelo);
        }