public override int GetHashCode() { unchecked { var hashCode = TaskId; hashCode = (hashCode * 397) ^ (Content != null ? Content.GetHashCode() : 0); hashCode = (hashCode * 397) ^ CreateTime.GetHashCode(); hashCode = (hashCode * 397) ^ StartTime.GetHashCode(); hashCode = (hashCode * 397) ^ (int)Priority; hashCode = (hashCode * 397) ^ (int)Urgency; hashCode = (hashCode * 397) ^ (int)Status; hashCode = (hashCode * 397) ^ EstimatedDuration; hashCode = (hashCode * 397) ^ EndTime.GetHashCode(); hashCode = (hashCode * 397) ^ (Memos != null ? Memos.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Tags != null ? Tags.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (ParentTaskId.GetHashCode()); hashCode = (hashCode * 397) ^ (PreTaskIds != null ? PreTaskIds.GetHashCode() : 0); return(hashCode); } }
public bool Equals(CNTask other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(TaskId == other.TaskId && string.Equals(Content, other.Content) && CreateTime.Equals(other.CreateTime) && StartTime.Equals(other.StartTime) && Priority == other.Priority && Urgency == other.Urgency && Status == other.Status && EstimatedDuration == other.EstimatedDuration && EndTime.Equals(other.EndTime) && (Memos == null && other.Memos == Memos) || (Memos != null && other.Memos != null && Memos.Count == other.Memos.Count && !Memos.Except(other.Memos).Any()) && (Tags == null && other.Tags == Tags) || (Tags != null && other.Tags != null && Tags.Count == other.Tags.Count && !Tags.Except(other.Tags).Any()) && Equals(ParentTaskId, other.ParentTaskId) && (PreTaskIds == null && other.PreTaskIds == PreTaskIds) || (PreTaskIds != null && other.PreTaskIds != null && PreTaskIds.Count == other.PreTaskIds.Count && !PreTaskIds.Except(other.PreTaskIds).Any())); }