/// <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 (ISBN != null)
         {
             hashCode = hashCode * 59 + ISBN.GetHashCode();
         }
         if (Nome != null)
         {
             hashCode = hashCode * 59 + Nome.GetHashCode();
         }
         if (Preco != null)
         {
             hashCode = hashCode * 59 + Preco.GetHashCode();
         }
         if (Autor != null)
         {
             hashCode = hashCode * 59 + Autor.GetHashCode();
         }
         if (Editora != null)
         {
             hashCode = hashCode * 59 + Editora.GetHashCode();
         }
         if (Categora != null)
         {
             hashCode = hashCode * 59 + Categora.GetHashCode();
         }
         return(hashCode);
     }
 }
Example #2
0
        public override int GetHashCode()
        {
            int hashCode = -1409227857;

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Nome);

            hashCode = hashCode * -1521134295 + Preco.GetHashCode();
            hashCode = hashCode * -1521134295 + QuantidadeEstoque.GetHashCode();
            return(hashCode);
        }
Example #3
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hash = 3;
         hash = 37 * hash + IdProduto;
         hash = 37 * hash + (Nome == null ? 0 : Nome.GetHashCode());
         hash = 37 * hash + (NomeCategoria == null ? 0 : NomeCategoria.GetHashCode());
         hash = 37 * hash + Preco.GetHashCode();
         hash = 37 * hash + (Ingredientes == null ? 0 : Ingredientes.GetHashCode());
         hash = 37 * hash + (Alergenios == null ? 0 : Alergenios.GetHashCode());
         return(hash);
     }
 }