예제 #1
0
        /// <summary>
        /// Compares two reserve now requests for equality.
        /// </summary>
        /// <param name="ReserveNowRequest">A reserve now request to compare with.</param>
        /// <returns>True if both match; False otherwise.</returns>
        public override Boolean Equals(ReserveNowRequest ReserveNowRequest)
        {
            if (ReserveNowRequest is null)
            {
                return(false);
            }

            return(ReservationId.Equals(ReserveNowRequest.ReservationId) &&
                   ConnectorId.Equals(ReserveNowRequest.ConnectorId) &&
                   ExpiryDate.Equals(ReserveNowRequest.ExpiryDate) &&
                   IdTag.Equals(ReserveNowRequest.IdTag) &&

                   ((!ParentIdTag.HasValue && !ReserveNowRequest.ParentIdTag.HasValue) ||
                    (ParentIdTag.HasValue && ReserveNowRequest.ParentIdTag.HasValue && ParentIdTag.Equals(ReserveNowRequest.ParentIdTag))));
        }