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

            return
                ((
                     CreatorEmail == other.CreatorEmail ||
                     CreatorEmail != null &&
                     CreatorEmail.Equals(other.CreatorEmail)
                     ) &&
                 (
                     Title == other.Title ||
                     Title != null &&
                     Title.Equals(other.Title)
                 ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     DateBegin == other.DateBegin ||
                     DateBegin != null &&
                     DateBegin.Equals(other.DateBegin)
                 ) &&
                 (
                     DateEnd == other.DateEnd ||
                     DateEnd != null &&
                     DateEnd.Equals(other.DateEnd)
                 ) &&
                 (
                     TimeZone == other.TimeZone ||
                     TimeZone != null &&
                     TimeZone.Equals(other.TimeZone)
                 ) &&
                 (
                     SessionId == other.SessionId ||
                     SessionId != null &&
                     SessionId.Equals(other.SessionId)
                 ));
        }
 /// <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 (CreatorEmail != null)
         {
             hashCode = hashCode * 59 + CreatorEmail.GetHashCode();
         }
         if (Title != null)
         {
             hashCode = hashCode * 59 + Title.GetHashCode();
         }
         if (Description != null)
         {
             hashCode = hashCode * 59 + Description.GetHashCode();
         }
         if (DateBegin != null)
         {
             hashCode = hashCode * 59 + DateBegin.GetHashCode();
         }
         if (DateEnd != null)
         {
             hashCode = hashCode * 59 + DateEnd.GetHashCode();
         }
         if (TimeZone != null)
         {
             hashCode = hashCode * 59 + TimeZone.GetHashCode();
         }
         if (SessionId != null)
         {
             hashCode = hashCode * 59 + SessionId.GetHashCode();
         }
         return(hashCode);
     }
 }
Esempio n. 3
0
 public CommentInput ToCommentInput()
 {
     return(new CommentInput(originalInput.ParentID, Body, Subscribe, SaveAnonymousUser, originalInput.Creator != null ? new UserAnonymous(CreatorName, CreatorEmail, originalInput.Creator.Email != CreatorEmail ? CreatorEmail.ComputeEmailHash() : originalInput.Creator.EmailHash, CreatorUrl) : null));
 }