Beispiel #1
0
        /// <summary>
        /// Returns true if Zone instances are equal
        /// </summary>
        /// <param name="other">Instance of Zone to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Zone other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     Metadata == other.Metadata ||
                     Metadata != null &&
                     Metadata.Equals(other.Metadata)
                 ) &&
                 (
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                 ) &&
                 (
                     Capacity == other.Capacity ||
                     Capacity != null &&
                     Capacity.Equals(other.Capacity)
                 ) &&
                 (
                     Peoplecount == other.Peoplecount ||
                     Peoplecount != null &&
                     Peoplecount.Equals(other.Peoplecount)
                 ) &&
                 (
                     BoundingPolygon == other.BoundingPolygon ||
                     BoundingPolygon != null &&
                     BoundingPolygon.SequenceEqual(other.BoundingPolygon)
                 ));
        }
Beispiel #2
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 (Id != null)
         {
             hashCode = hashCode * 59 + Id.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (Description != null)
         {
             hashCode = hashCode * 59 + Description.GetHashCode();
         }
         if (Metadata != null)
         {
             hashCode = hashCode * 59 + Metadata.GetHashCode();
         }
         if (Type != null)
         {
             hashCode = hashCode * 59 + Type.GetHashCode();
         }
         if (Capacity != null)
         {
             hashCode = hashCode * 59 + Capacity.GetHashCode();
         }
         if (Peoplecount != null)
         {
             hashCode = hashCode * 59 + Peoplecount.GetHashCode();
         }
         if (BoundingPolygon != null)
         {
             hashCode = hashCode * 59 + BoundingPolygon.GetHashCode();
         }
         return(hashCode);
     }
 }