Example #1
0
 /// <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 (Titulo != null)
         {
             hashCode = hashCode * 59 + Titulo.GetHashCode();
         }
         if (Autor != null)
         {
             hashCode = hashCode * 59 + Autor.GetHashCode();
         }
         if (Genero != null)
         {
             hashCode = hashCode * 59 + Genero.GetHashCode();
         }
         if (Data != null)
         {
             hashCode = hashCode * 59 + Data.GetHashCode();
         }
         if (Preco != null)
         {
             hashCode = hashCode * 59 + Preco.GetHashCode();
         }
         return(hashCode);
     }
 }
Example #2
0
 public override int GetHashCode()
 {
     return((GetType().GetHashCode() * 900) + Titulo.GetHashCode());
 }
Example #3
0
 public override int GetHashCode()
 {
     return(Titulo.GetHashCode());
 }