Created
June 6, 2019 10:07
-
-
Save Macadoshis/3e1fb4ddb19b00274be9c16555cbfdac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using CMSS.Domain.ServiceFolderManagement; | |
namespace CMSS.Application.StateMachine.Base | |
{ | |
public class TransitionServiceFolderPair | |
{ | |
public TransitionServiceFolderPair(ServiceFolderStatus source, ServiceFolderStatus target, bool changeRequest = false) | |
{ | |
Source = source; | |
Target = target; | |
ChangeRequest = changeRequest; | |
} | |
public ServiceFolderStatus Source { get; } | |
public ServiceFolderStatus Target { get; } | |
public bool ChangeRequest { get; } | |
protected bool Equals(TransitionServiceFolderPair other) | |
{ | |
return Source == other.Source && Target == other.Target && ChangeRequest == other.ChangeRequest; | |
} | |
public override bool Equals(object obj) | |
{ | |
if (ReferenceEquals(null, obj)) return false; | |
if (ReferenceEquals(this, obj)) return true; | |
if (obj.GetType() != this.GetType()) return false; | |
return Equals((TransitionServiceFolderPair)obj); | |
} | |
public override int GetHashCode() | |
{ | |
unchecked | |
{ | |
var hashCode = (int)Source; | |
hashCode = (hashCode * 397) ^ (int)Target; | |
hashCode = (hashCode * 397) ^ ChangeRequest.GetHashCode(); | |
return hashCode; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment