Exemple #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 (Project != null)
                {
                    hash = hash * 59 + Project.GetHashCode();
                }

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

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

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

                hash = hash * 59 + EquipmentCount.GetHashCode();

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

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

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

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

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

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

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

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

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

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

            return
                ((
                     Id == other.Id ||
                     Id.Equals(other.Id)
                     ) &&
                 (
                     Project == other.Project ||
                     Project != null &&
                     Project.Equals(other.Project)
                 ) &&
                 (
                     LocalArea == other.LocalArea ||
                     LocalArea != null &&
                     LocalArea.Equals(other.LocalArea)
                 ) &&
                 (
                     Status == other.Status ||
                     Status != null &&
                     Status.Equals(other.Status)
                 ) &&
                 (
                     DistrictEquipmentType == other.DistrictEquipmentType ||
                     DistrictEquipmentType != null &&
                     DistrictEquipmentType.Equals(other.DistrictEquipmentType)
                 ) &&
                 (
                     EquipmentCount == other.EquipmentCount ||
                     EquipmentCount.Equals(other.EquipmentCount)
                 ) &&
                 (
                     ExpectedHours == other.ExpectedHours ||
                     ExpectedHours != null &&
                     ExpectedHours.Equals(other.ExpectedHours)
                 ) &&
                 (
                     ExpectedStartDate == other.ExpectedStartDate ||
                     ExpectedStartDate != null &&
                     ExpectedStartDate.Equals(other.ExpectedStartDate)
                 ) &&
                 (
                     ExpectedEndDate == other.ExpectedEndDate ||
                     ExpectedEndDate != null &&
                     ExpectedEndDate.Equals(other.ExpectedEndDate)
                 ) &&
                 (
                     FirstOnRotationList == other.FirstOnRotationList ||
                     FirstOnRotationList != null &&
                     FirstOnRotationList.Equals(other.FirstOnRotationList)
                 ) &&
                 (
                     Notes == other.Notes ||
                     Notes != null &&
                     Notes.SequenceEqual(other.Notes)
                 ) &&
                 (
                     Attachments == other.Attachments ||
                     Attachments != null &&
                     Attachments.SequenceEqual(other.Attachments)
                 ) &&
                 (
                     History == other.History ||
                     History != null &&
                     History.SequenceEqual(other.History)
                 ) &&
                 (
                     RentalRequestAttachments == other.RentalRequestAttachments ||
                     RentalRequestAttachments != null &&
                     RentalRequestAttachments.SequenceEqual(other.RentalRequestAttachments)
                 ) &&
                 (
                     RentalRequestRotationList == other.RentalRequestRotationList ||
                     RentalRequestRotationList != null &&
                     RentalRequestRotationList.SequenceEqual(other.RentalRequestRotationList)
                 ));
        }