Ejemplo n.º 1
0
 /// <summary>
 ///     Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked            // Overflow is fine, just wrap
     {
         int hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Id != null)
         {
             hashCode = hashCode * 59 + Id.GetHashCode();
         }
         if (Opening != null)
         {
             hashCode = hashCode * 59 + Opening.GetHashCode();
         }
         if (Closing != null)
         {
             hashCode = hashCode * 59 + Closing.GetHashCode();
         }
         if (Highest != null)
         {
             hashCode = hashCode * 59 + Highest.GetHashCode();
         }
         if (Lowest != null)
         {
             hashCode = hashCode * 59 + Lowest.GetHashCode();
         }
         if (Volume != null)
         {
             hashCode = hashCode * 59 + Volume.GetHashCode();
         }
         if (Turnover != null)
         {
             hashCode = hashCode * 59 + Turnover.GetHashCode();
         }
         return(hashCode);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Returns a hash code for this instance.
 /// </summary>
 /// <returns>
 /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
 /// </returns>
 public override int GetHashCode()
 {
     return(Highest.GetHashCode() ^ Lowest.GetHashCode() ^ Calendar.GetHashCode());
 }