public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hash = ProcessTaskId.GetHashCode(); // Suitable nullity checks etc, of course :) if (ProcessTaskName != null) { hash = hash * 17 + ProcessTaskName.GetHashCode(); } if (ProcessTaskOwner != null) { hash = hash * 17 + ProcessTaskOwner.GetHashCode(); } if (ParentTaskId != null) { hash = hash * 17 + ParentTaskId.GetHashCode(); } hash = hash * 17 + Priority.GetHashCode(); if (ProcessKey != null) { hash = hash * 17 + ProcessKey.GetHashCode(); } if (ProcessInstanceId != null) { hash = hash * 17 + ProcessInstanceId.GetHashCode(); } if (ProcessItemDefinitionId != null) { hash = hash * 17 + ProcessItemDefinitionId.GetHashCode(); } hash = hash * 17 + SuspensionState.GetHashCode(); return(hash); } }
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(ProcessTask other) { // Check for null if (ReferenceEquals(other, null)) { return(false); } // Check for same reference if (ReferenceEquals(this, other)) { return(true); } // Not Check ProcessTaskId, because generated Guid // Check for same value return(((ProcessTaskName == null && other.ProcessTaskName == null) || (ProcessTaskName != null && other.ProcessTaskName != null && ProcessTaskName.Equals(other.ProcessTaskName))) && ((ProcessTaskOwner == null && other.ProcessTaskOwner == null) || (ProcessTaskOwner != null && other.ProcessTaskOwner != null && ProcessTaskOwner.Equals(other.ProcessTaskOwner))) && ((ParentTaskId == null && other.ParentTaskId == null) || (ParentTaskId != null && other.ParentTaskId != null && ParentTaskId.Equals(other.ParentTaskId))) && ((ProcessKey == null && other.ProcessKey == null) || (ProcessKey != null && other.ProcessKey != null && ProcessKey.Equals(other.ProcessKey))) && ((ProcessInstanceId == null && other.ProcessInstanceId == null) || (ProcessInstanceId != null && other.ProcessInstanceId != null && ProcessInstanceId.Equals(other.ProcessInstanceId))) && ((ProcessItemDefinitionId == null && other.ProcessItemDefinitionId == null) || (ProcessItemDefinitionId != null && other.ProcessItemDefinitionId != null && ProcessItemDefinitionId.Equals(other.ProcessItemDefinitionId))) && SuspensionState.Equals(other.SuspensionState)); }