namespace BS.Shared.DataContracts
{
    public partial class AccountingTransactionDC
    {
        public override bool Equals(object obj)
        {
            if (obj is AccountingTransactionDC)
            {
                var y = (AccountingTransactionDC)obj;
                if (this.AccountingTransactionOid == null && y.AccountingTransactionOid == null)
                {
                    return this.GetHashCode() == y.GetHashCode();
                }

                if (this.AccountingTransactionOid != null && y.AccountingTransactionOid != null)
                {
                    return this.AccountingTransactionOid == y.AccountingTransactionOid;
                }
            }

            return false;
        }

        public override int GetHashCode()
        {
            return this.AccountingTransactionOid.HasValue ? this.GetType().Name.GetHashCode() ^ this.AccountingTransactionOid.GetHashCode() : base.GetHashCode();
        }
    }
}