Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. using CMSS.Domain.ServiceFolderManagement;
  2.  
  3. namespace CMSS.Application.StateMachine.Base
  4. {
  5. public class TransitionServiceFolderPair
  6. {
  7. public TransitionServiceFolderPair(ServiceFolderStatus source, ServiceFolderStatus target, bool changeRequest = false)
  8. {
  9. Source = source;
  10. Target = target;
  11. ChangeRequest = changeRequest;
  12. }
  13.  
  14. public ServiceFolderStatus Source { get; }
  15. public ServiceFolderStatus Target { get; }
  16. public bool ChangeRequest { get; }
  17.  
  18. protected bool Equals(TransitionServiceFolderPair other)
  19. {
  20. return Source == other.Source && Target == other.Target && ChangeRequest == other.ChangeRequest;
  21. }
  22.  
  23. public override bool Equals(object obj)
  24. {
  25. if (ReferenceEquals(null, obj)) return false;
  26. if (ReferenceEquals(this, obj)) return true;
  27. if (obj.GetType() != this.GetType()) return false;
  28. return Equals((TransitionServiceFolderPair)obj);
  29. }
  30.  
  31. public override int GetHashCode()
  32. {
  33. unchecked
  34. {
  35. var hashCode = (int)Source;
  36. hashCode = (hashCode * 397) ^ (int)Target;
  37. hashCode = (hashCode * 397) ^ ChangeRequest.GetHashCode();
  38. return hashCode;
  39. }
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement