예제 #1
0
 public override int GetHashCode()
 {
     return(37
            ^ Id.GetHashCode()
            ^ AgencyId.GetHashCode()
            ^ Version.GetHashCode());
 }
예제 #2
0
        /// <summary>
        /// Returns true if BookingConfirmedEvent instances are equal
        /// </summary>
        /// <param name="other">Instance of BookingConfirmedEvent to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(BookingConfirmedEvent other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     BookingRequestId == other.BookingRequestId ||
                     BookingRequestId != null &&
                     BookingRequestId.Equals(other.BookingRequestId)
                     ) &&
                 (
                     BookingId == other.BookingId ||
                     BookingId != null &&
                     BookingId.Equals(other.BookingId)
                 ) &&
                 (
                     AgencyId == other.AgencyId ||
                     AgencyId != null &&
                     AgencyId.Equals(other.AgencyId)
                 ) &&
                 (
                     Cost == other.Cost ||

                     Cost.Equals(other.Cost)
                 ));
        }
예제 #3
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 (PersonId != null)
                {
                    hashCode = hashCode * 59 + PersonId.GetHashCode();
                }

                hashCode = hashCode * 59 + EngagementRoute.GetHashCode();
                if (AgencyId != null)
                {
                    hashCode = hashCode * 59 + AgencyId.GetHashCode();
                }

                hashCode = hashCode * 59 + Cost.GetHashCode();
                if (CancellationCosts != null)
                {
                    hashCode = hashCode * 59 + CancellationCosts.GetHashCode();
                }
                return(hashCode);
            }
        }
예제 #4
0
        /// <summary>
        /// Returns true if AgencyCosting instances are equal
        /// </summary>
        /// <param name="other">Instance of AgencyCosting to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(AgencyCosting other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     AgencyId == other.AgencyId ||
                     AgencyId != null &&
                     AgencyId.Equals(other.AgencyId)
                     ) &&
                 (
                     AgencyName == other.AgencyName ||
                     AgencyName != null &&
                     AgencyName.Equals(other.AgencyName)
                 ) &&
                 (
                     Cost == other.Cost ||

                     Cost.Equals(other.Cost)
                 ));
        }
        public override int GetHashCode()
        {
            var hashCode = AgencyId.GetHashCode();

            hashCode = (hashCode * 397) ^ RouteId.GetHashCode();
            hashCode = (hashCode * 397) ^ RouteType.GetHashCode();
            hashCode = (hashCode * 397) ^ TripId.GetHashCode();
            hashCode = (hashCode * 397) ^ StopId.GetHashCode();

            return(hashCode);
        }
예제 #6
0
        public bool Equals(CodeListRef other)
        {
            if (other == null)
            {
                return(false);
            }

            return(Id.Equals(other.Id) &&
                   AgencyId.Equals(other.AgencyId) &&
                   Version.Equals(other.Version) &&
                   Alias.Equals(other.Alias));
        }
예제 #7
0
 public void Deconstruct(out SubjectMarkupScopeTypes type, out int?agencyId, out int?agentId, out string agentScopeId)
 {
     type         = Type;
     agentScopeId = Type switch
     {
         SubjectMarkupScopeTypes.Global => "",
         SubjectMarkupScopeTypes.Country => LocationId,
         SubjectMarkupScopeTypes.Locality => LocationId,
         SubjectMarkupScopeTypes.Agency => AgencyId.ToString(),
         SubjectMarkupScopeTypes.Agent => AgentInAgencyId.Create(AgentId.Value, AgencyId.Value).ToString(),
         _ => throw new ArgumentOutOfRangeException(nameof(type), Type, "Wrong AgentMarkupScopeType")
     };
     agencyId = AgencyId;
     agentId  = AgentId;
 }
예제 #8
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 (AgencyId != null)
                {
                    hashCode = hashCode * 59 + AgencyId.GetHashCode();
                }
                if (AgencyName != null)
                {
                    hashCode = hashCode * 59 + AgencyName.GetHashCode();
                }

                hashCode = hashCode * 59 + Cost.GetHashCode();
                return(hashCode);
            }
        }
예제 #9
0
        /// <summary>
        /// Returns true if ProposalDetails instances are equal
        /// </summary>
        /// <param name="other">Instance of ProposalDetails to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ProposalDetails other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     PersonId == other.PersonId ||
                     PersonId != null &&
                     PersonId.Equals(other.PersonId)
                     ) &&
                 (
                     EngagementRoute == other.EngagementRoute ||

                     EngagementRoute.Equals(other.EngagementRoute)
                 ) &&
                 (
                     AgencyId == other.AgencyId ||
                     AgencyId != null &&
                     AgencyId.Equals(other.AgencyId)
                 ) &&
                 (
                     Cost == other.Cost ||

                     Cost.Equals(other.Cost)
                 ) &&
                 (
                     CancellationCosts == other.CancellationCosts ||
                     CancellationCosts != null &&
                     other.CancellationCosts != null &&
                     CancellationCosts.SequenceEqual(other.CancellationCosts)
                 ));
        }
예제 #10
0
 public List <string> GetAgency()
 {
     return(AgencyId?.Where(x => x != null).ToList() ?? new List <string>());
 }
예제 #11
0
 public bool Equals(MaintainableArtefact other)
 {
     return(AgencyId.Equals(other.AgencyId) &&
            Id.Equals(other.Id) &&
            Version.Equals(other.Version));
 }