示例#1
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hashCode = 41;
         if (Reference != null)
         {
             hashCode = hashCode * 59 + Reference.GetHashCode();
         }
         if (Store != null)
         {
             hashCode = hashCode * 59 + Store.GetHashCode();
         }
         if (OpenHours != null)
         {
             hashCode = hashCode * 59 + OpenHours.GetHashCode();
         }
         if (SpecialHours != null)
         {
             hashCode = hashCode * 59 + SpecialHours.GetHashCode();
         }
         if (Menu != null)
         {
             hashCode = hashCode * 59 + Menu.GetHashCode();
         }
         return(hashCode);
     }
 }
示例#2
0
        /// <summary>
        /// Returns true if StoreMenu instances are equal
        /// </summary>
        /// <param name="input">Instance of StoreMenu to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(StoreMenu input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Reference == input.Reference ||
                     Reference != null &&
                     Reference.Equals(input.Reference)
                     ) &&
                 (
                     Store == input.Store ||
                     Store != null &&
                     Store.Equals(input.Store)
                 ) &&
                 (
                     OpenHours == input.OpenHours ||
                     OpenHours != null &&
                     OpenHours.SequenceEqual(input.OpenHours)
                 ) &&
                 (
                     SpecialHours == input.SpecialHours ||
                     SpecialHours != null &&
                     SpecialHours.SequenceEqual(input.SpecialHours)
                 ) &&
                 (
                     Menu == input.Menu ||
                     Menu != null &&
                     Menu.Equals(input.Menu)
                 ));
        }