Exemplo n.º 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 (WorkerId != null)
         {
             hashCode = hashCode * 59 + WorkerId.GetHashCode();
         }
         if (Duty != null)
         {
             hashCode = hashCode * 59 + Duty.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemplo n.º 2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (WorkerId.Length != 0)
            {
                hash ^= WorkerId.GetHashCode();
            }
            if (WorkerAdress.Length != 0)
            {
                hash ^= WorkerAdress.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }