Esempio 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 (Incidentid != null)
         {
             hashCode = hashCode * 59 + Incidentid.GetHashCode();
         }
         if (Description != null)
         {
             hashCode = hashCode * 59 + Description.GetHashCode();
         }
         if (Type != null)
         {
             hashCode = hashCode * 59 + Type.GetHashCode();
         }
         if (Position != null)
         {
             hashCode = hashCode * 59 + Position.GetHashCode();
         }
         if (Prio != null)
         {
             hashCode = hashCode * 59 + Prio.GetHashCode();
         }
         if (Status != null)
         {
             hashCode = hashCode * 59 + Status.GetHashCode();
         }
         if (Probability != null)
         {
             hashCode = hashCode * 59 + Probability.GetHashCode();
         }
         if (Interventionplan != null)
         {
             hashCode = hashCode * 59 + Interventionplan.GetHashCode();
         }
         if (Incidenttime != null)
         {
             hashCode = hashCode * 59 + Incidenttime.GetHashCode();
         }
         if (Wbid != null)
         {
             hashCode = hashCode * 59 + Wbid.GetHashCode();
         }
         if (Telephone != null)
         {
             hashCode = hashCode * 59 + Telephone.GetHashCode();
         }
         if (AdditionalMedia != null)
         {
             hashCode = hashCode * 59 + AdditionalMedia.GetHashCode();
         }
         if (MediaType != null)
         {
             hashCode = hashCode * 59 + MediaType.GetHashCode();
         }
         if (Area != null)
         {
             hashCode = hashCode * 59 + Area.GetHashCode();
         }
         return(hashCode);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Returns true if Incident instances are equal
        /// </summary>
        /// <param name="other">Instance of Incident to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Incident other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Incidentid == other.Incidentid ||
                     Incidentid != null &&
                     Incidentid.Equals(other.Incidentid)
                     ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                 ) &&
                 (
                     Position == other.Position ||
                     Position != null &&
                     Position.Equals(other.Position)
                 ) &&
                 (
                     Prio == other.Prio ||
                     Prio != null &&
                     Prio.Equals(other.Prio)
                 ) &&
                 (
                     Status == other.Status ||
                     Status != null &&
                     Status.Equals(other.Status)
                 ) &&
                 (
                     Probability == other.Probability ||
                     Probability != null &&
                     Probability.Equals(other.Probability)
                 ) &&
                 (
                     Interventionplan == other.Interventionplan ||
                     Interventionplan != null &&
                     Interventionplan.Equals(other.Interventionplan)
                 ) &&
                 (
                     Incidenttime == other.Incidenttime ||
                     Incidenttime != null &&
                     Incidenttime.Equals(other.Incidenttime)
                 ) &&
                 (
                     Wbid == other.Wbid ||
                     Wbid != null &&
                     Wbid.Equals(other.Wbid)
                 ) &&
                 (
                     Telephone == other.Telephone ||
                     Telephone != null &&
                     Telephone.Equals(other.Telephone)
                 ) &&
                 (
                     AdditionalMedia == other.AdditionalMedia ||
                     AdditionalMedia != null &&
                     AdditionalMedia.Equals(other.AdditionalMedia)
                 ) &&
                 (
                     MediaType == other.MediaType ||
                     MediaType != null &&
                     MediaType.Equals(other.MediaType)
                 ) &&
                 (
                     Area == other.Area ||
                     Area != null &&
                     MediaType.Equals(other.Area)
                 ));
        }