Skip to content

Instantly share code, notes, and snippets.

@Macadoshis
Created June 6, 2019 10:07
Show Gist options
  • Save Macadoshis/3e1fb4ddb19b00274be9c16555cbfdac to your computer and use it in GitHub Desktop.
Save Macadoshis/3e1fb4ddb19b00274be9c16555cbfdac to your computer and use it in GitHub Desktop.
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