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

            return
                ((
                     Id == other.Id ||
                     Id.Equals(other.Id)
                     ) &&
                 (
                     RentalRequest == other.RentalRequest ||
                     RentalRequest != null &&
                     RentalRequest.Equals(other.RentalRequest)
                 ) &&
                 (
                     Attachment == other.Attachment ||
                     Attachment != null &&
                     Attachment.Equals(other.Attachment)
                 ));
        }
        /// <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 (RentalRequest != null)
                {
                    hash = hash * 59 + RentalRequest.GetHashCode();
                }

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

                return(hash);
            }
        }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RentalRequestAttachment" /> class.
 /// </summary>
 /// <param name="Id">A system-generated unique identifier for a RentalRequestAttachment (required).</param>
 /// <param name="RentalRequest">A foreign key reference to the system-generated unique identifier for a Rental Request (required).</param>
 /// <param name="Attachment">The name&amp;#x2F;type attachment needed as part of the fulfillment of the request (required).</param>
 public RentalRequestAttachment(int Id, RentalRequest RentalRequest, string Attachment)
 {
     this.Id            = Id;
     this.RentalRequest = RentalRequest;
     this.Attachment    = Attachment;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RentalRequestAttachment" /> class.
 /// </summary>
 /// <param name="id">A system-generated unique identifier for a RentalRequestAttachment (required).</param>
 /// <param name="rentalRequest">A foreign key reference to the system-generated unique identifier for a Rental Request (required).</param>
 /// <param name="attachment">The name&amp;#x2F;type attachment needed as part of the fulfillment of the request (required).</param>
 public RentalRequestAttachment(int id, RentalRequest rentalRequest, string attachment)
 {
     Id            = id;
     RentalRequest = rentalRequest;
     Attachment    = attachment;
 }