예제 #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 (RegionId != null)
         {
             hashCode = hashCode * 59 + RegionId.GetHashCode();
         }
         if (RegionNm != null)
         {
             hashCode = hashCode * 59 + RegionNm.GetHashCode();
         }
         if (FarmId != null)
         {
             hashCode = hashCode * 59 + FarmId.GetHashCode();
         }
         if (Plant != null)
         {
             hashCode = hashCode * 59 + Plant.GetHashCode();
         }
         return(hashCode);
     }
 }
예제 #2
0
        /// <summary>
        /// Returns true if InitData instances are equal
        /// </summary>
        /// <param name="other">Instance of InitData to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(InitData other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     RegionId == other.RegionId ||
                     RegionId != null &&
                     RegionId.Equals(other.RegionId)
                     ) &&
                 (
                     RegionNm == other.RegionNm ||
                     RegionNm != null &&
                     RegionNm.Equals(other.RegionNm)
                 ) &&
                 (
                     FarmId == other.FarmId ||
                     FarmId != null &&
                     FarmId.Equals(other.FarmId)
                 ) &&
                 (
                     Plant == other.Plant ||
                     Plant != null &&
                     Plant.SequenceEqual(other.Plant)
                 ));
        }