Exemplo n.º 1
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            // credit: http://stackoverflow.com/a/263416/677735
            unchecked // Overflow is fine, just wrap
            {
                int hash = 41;

                // Suitable nullity checks
                hash = hash * 59 + Id.GetHashCode();

                if (LocalArea != null)
                {
                    hash = hash * 59 + LocalArea.GetHashCode();
                }

                if (EquipmentCount != null)
                {
                    hash = hash * 59 + EquipmentCount.GetHashCode();
                }

                if (EquipmentTypeName != null)
                {
                    hash = hash * 59 + EquipmentTypeName.GetHashCode();
                }

                if (DistrictEquipmentName != null)
                {
                    hash = hash * 59 + DistrictEquipmentName.GetHashCode();
                }

                if (ProjectName != null)
                {
                    hash = hash * 59 + ProjectName.GetHashCode();
                }

                if (PrimaryContact != null)
                {
                    hash = hash * 59 + PrimaryContact.GetHashCode();
                }

                if (Status != null)
                {
                    hash = hash * 59 + Status.GetHashCode();
                }

                if (ProjectId != null)
                {
                    hash = hash * 59 + ProjectId.GetHashCode();
                }

                if (ExpectedStartDate != null)
                {
                    hash = hash * 59 + ExpectedStartDate.GetHashCode();
                }

                if (ExpectedEndDate != null)
                {
                    hash = hash * 59 + ExpectedEndDate.GetHashCode();
                }

                return(hash);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Returns true if RentalRequestSearchResultViewModel instances are equal
        /// </summary>
        /// <param name="other">Instance of RentalRequestSearchResultViewModel to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(RentalRequestSearchResultViewModel other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id.Equals(other.Id)
                     ) &&
                 (
                     LocalArea == other.LocalArea ||
                     LocalArea != null &&
                     LocalArea.Equals(other.LocalArea)
                 ) &&
                 (
                     EquipmentCount == other.EquipmentCount ||
                     EquipmentCount != null &&
                     EquipmentCount.Equals(other.EquipmentCount)
                 ) &&
                 (
                     EquipmentTypeName == other.EquipmentTypeName ||
                     EquipmentTypeName != null &&
                     EquipmentTypeName.Equals(other.EquipmentTypeName)
                 ) &&
                 (
                     DistrictEquipmentName == other.DistrictEquipmentName ||
                     DistrictEquipmentName != null &&
                     DistrictEquipmentName.Equals(other.DistrictEquipmentName)
                 ) &&
                 (
                     ProjectName == other.ProjectName ||
                     ProjectName != null &&
                     ProjectName.Equals(other.ProjectName)
                 ) &&
                 (
                     PrimaryContact == other.PrimaryContact ||
                     PrimaryContact != null &&
                     PrimaryContact.Equals(other.PrimaryContact)
                 ) &&
                 (
                     Status == other.Status ||
                     Status != null &&
                     Status.Equals(other.Status)
                 ) &&
                 (
                     ProjectId == other.ProjectId ||
                     ProjectId != null &&
                     ProjectId.Equals(other.ProjectId)
                 ) &&
                 (
                     ExpectedStartDate == other.ExpectedStartDate ||
                     ExpectedStartDate != null &&
                     ExpectedStartDate.Equals(other.ExpectedStartDate)
                 ) &&
                 (
                     ExpectedEndDate == other.ExpectedEndDate ||
                     ExpectedEndDate != null &&
                     ExpectedEndDate.Equals(other.ExpectedEndDate)
                 ));
        }