Пример #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 (TagId != null)
         {
             hashCode = hashCode * 59 + TagId.GetHashCode();
         }
         if (SecondTagId != null)
         {
             hashCode = hashCode * 59 + SecondTagId.GetHashCode();
         }
         if (IsUntaggable != null)
         {
             hashCode = hashCode * 59 + IsUntaggable.GetHashCode();
         }
         if (Latitude != null)
         {
             hashCode = hashCode * 59 + Latitude.GetHashCode();
         }
         if (Longitude != null)
         {
             hashCode = hashCode * 59 + Longitude.GetHashCode();
         }
         if (LastModified != null)
         {
             hashCode = hashCode * 59 + LastModified.GetHashCode();
         }
         if (Created != null)
         {
             hashCode = hashCode * 59 + Created.GetHashCode();
         }
         if (Creator != null)
         {
             hashCode = hashCode * 59 + Creator.GetHashCode();
         }
         if (Comment != null)
         {
             hashCode = hashCode * 59 + Comment.GetHashCode();
         }
         if (ShareTags != null)
         {
             hashCode = hashCode * 59 + ShareTags.GetHashCode();
         }
         if (SapAsset != null)
         {
             hashCode = hashCode * 59 + SapAsset.GetHashCode();
         }
         if (AssetNumber != null)
         {
             hashCode = hashCode * 59 + AssetNumber.GetHashCode();
         }
         if (SubNumber != null)
         {
             hashCode = hashCode * 59 + SubNumber.GetHashCode();
         }
         if (CompanyCode != null)
         {
             hashCode = hashCode * 59 + CompanyCode.GetHashCode();
         }
         return(hashCode);
     }
 }
Пример #2
0
        /// <summary>
        /// Returns true if Asset instances are equal
        /// </summary>
        /// <param name="other">Instance of Asset to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Asset other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     TagId == other.TagId ||
                     TagId != null &&
                     TagId.Equals(other.TagId)
                     ) &&
                 (
                     SecondTagId == other.SecondTagId ||
                     SecondTagId != null &&
                     SecondTagId.Equals(other.SecondTagId)
                 ) &&
                 (
                     IsUntaggable == other.IsUntaggable ||
                     IsUntaggable != null &&
                     IsUntaggable.Equals(other.IsUntaggable)
                 ) &&
                 (
                     Latitude == other.Latitude ||
                     Latitude != null &&
                     Latitude.Equals(other.Latitude)
                 ) &&
                 (
                     Longitude == other.Longitude ||
                     Longitude != null &&
                     Longitude.Equals(other.Longitude)
                 ) &&
                 (
                     LastModified == other.LastModified ||
                     LastModified != null &&
                     LastModified.Equals(other.LastModified)
                 ) &&
                 (
                     Created == other.Created ||
                     Created != null &&
                     Created.Equals(other.Created)
                 ) &&
                 (
                     Creator == other.Creator ||
                     Creator != null &&
                     Creator.Equals(other.Creator)
                 ) &&
                 (
                     Comment == other.Comment ||
                     Comment != null &&
                     Comment.Equals(other.Comment)
                 ) &&
                 (
                     ShareTags == other.ShareTags ||
                     ShareTags != null &&
                     ShareTags.Equals(other.ShareTags)
                 ) &&
                 (
                     SapAsset == other.SapAsset ||
                     SapAsset != null &&
                     SapAsset.Equals(other.SapAsset)
                 ) &&
                 (
                     AssetNumber == other.AssetNumber ||
                     AssetNumber != null &&
                     AssetNumber.Equals(other.AssetNumber)
                 ) &&
                 (
                     SubNumber == other.SubNumber ||
                     SubNumber != null &&
                     SubNumber.Equals(other.SubNumber)
                 ) &&
                 (
                     CompanyCode == other.CompanyCode ||
                     CompanyCode != null &&
                     CompanyCode.Equals(other.CompanyCode)
                 ));
        }