-
-
Save ste-bel/cd07f0bc9810b11ead1aafa818606765 to your computer and use it in GitHub Desktop.
ConversionKey - A POCO to store conversion criteria and data
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 System; | |
using System.Collections.Generic; | |
namespace PB.Objects.B2B.Slot { | |
public class ConversionKey : IEquatable<ConversionKey> { | |
public ConversionKey(string organizationID, int? bAccountID, string messageType, string convertFrom) { | |
OrganizationID = organizationID; | |
BAccountID = bAccountID; | |
MessageType = messageType; | |
ConvertFrom = convertFrom; | |
} | |
public string OrganizationID { get; private set; } | |
public int? BAccountID { get; private set; } | |
public string MessageType { get; private set; } | |
public string ConvertFrom { get; private set; } | |
public bool Equals(ConversionKey other) { | |
return | |
this.OrganizationID == other.OrganizationID && | |
this.BAccountID == other.BAccountID && | |
this.MessageType == other.MessageType && | |
this.ConvertFrom == other.ConvertFrom; | |
} | |
public override int GetHashCode() { | |
var hashCode = 219003723; | |
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(OrganizationID); | |
hashCode = hashCode * -1521134295 + EqualityComparer<int?>.Default.GetHashCode(BAccountID); | |
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(MessageType); | |
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(ConvertFrom); | |
return hashCode; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment