Exemplo n.º 1
0
        /// <summary>
        /// Returns true if MenuDetails instances are equal
        /// </summary>
        /// <param name="input">Instance of MenuDetails to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(MenuDetails input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     MenuId == input.MenuId ||
                     MenuId != null &&
                     MenuId.Equals(input.MenuId)
                     ) &&
                 (
                     Name == input.Name ||
                     Name != null &&
                     Name.Equals(input.Name)
                 ) &&
                 (
                     Subtitle == input.Subtitle ||
                     Subtitle != null &&
                     Subtitle.Equals(input.Subtitle)
                 ) &&
                 (
                     IsActive == input.IsActive ||
                     IsActive != null &&
                     IsActive.Equals(input.IsActive)
                 ) &&
                 (
                     IsPosMenu == input.IsPosMenu ||
                     IsPosMenu != null &&
                     IsPosMenu.Equals(input.IsPosMenu)
                 ) &&
                 (
                     LatestMenuUpdate == input.LatestMenuUpdate ||
                     LatestMenuUpdate != null &&
                     LatestMenuUpdate.Equals(input.LatestMenuUpdate)
                 ) &&
                 (
                     LastSuccessfulMenuUpdateAt == input.LastSuccessfulMenuUpdateAt ||
                     LastSuccessfulMenuUpdateAt != null &&
                     LastSuccessfulMenuUpdateAt.Equals(input.LastSuccessfulMenuUpdateAt)
                 ) &&
                 (
                     Url == input.Url ||
                     Url != null &&
                     Url.Equals(input.Url)
                 ) &&
                 (
                     OpenHours == input.OpenHours ||
                     OpenHours != null &&
                     OpenHours.SequenceEqual(input.OpenHours)
                 ) &&
                 (
                     SpecialHours == input.SpecialHours ||
                     SpecialHours != null &&
                     SpecialHours.SequenceEqual(input.SpecialHours)
                 ));
        }
Exemplo n.º 2
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 (MenuId != null)
         {
             hashCode = hashCode * 59 + MenuId.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (Subtitle != null)
         {
             hashCode = hashCode * 59 + Subtitle.GetHashCode();
         }
         if (IsActive != null)
         {
             hashCode = hashCode * 59 + IsActive.GetHashCode();
         }
         if (IsPosMenu != null)
         {
             hashCode = hashCode * 59 + IsPosMenu.GetHashCode();
         }
         if (LatestMenuUpdate != null)
         {
             hashCode = hashCode * 59 + LatestMenuUpdate.GetHashCode();
         }
         if (LastSuccessfulMenuUpdateAt != null)
         {
             hashCode = hashCode * 59 + LastSuccessfulMenuUpdateAt.GetHashCode();
         }
         if (Url != null)
         {
             hashCode = hashCode * 59 + Url.GetHashCode();
         }
         if (OpenHours != null)
         {
             hashCode = hashCode * 59 + OpenHours.GetHashCode();
         }
         if (SpecialHours != null)
         {
             hashCode = hashCode * 59 + SpecialHours.GetHashCode();
         }
         return(hashCode);
     }
 }