Ejemplo n.º 1
0
        public override int GetHashCode()
        {
            int hashCode = -498109440;

            if (Id != null)
            {
                hashCode += Id.GetHashCode();
            }

            if (State != null)
            {
                hashCode += State.GetHashCode();
            }

            if (OpenedAt != null)
            {
                hashCode += OpenedAt.GetHashCode();
            }

            if (EndedAt != null)
            {
                hashCode += EndedAt.GetHashCode();
            }

            if (ClosedAt != null)
            {
                hashCode += ClosedAt.GetHashCode();
            }

            if (EmployeeIds != null)
            {
                hashCode += EmployeeIds.GetHashCode();
            }

            if (OpeningEmployeeId != null)
            {
                hashCode += OpeningEmployeeId.GetHashCode();
            }

            if (EndingEmployeeId != null)
            {
                hashCode += EndingEmployeeId.GetHashCode();
            }

            if (ClosingEmployeeId != null)
            {
                hashCode += ClosingEmployeeId.GetHashCode();
            }

            if (Description != null)
            {
                hashCode += Description.GetHashCode();
            }

            if (OpenedCashMoney != null)
            {
                hashCode += OpenedCashMoney.GetHashCode();
            }

            if (CashPaymentMoney != null)
            {
                hashCode += CashPaymentMoney.GetHashCode();
            }

            if (CashRefundsMoney != null)
            {
                hashCode += CashRefundsMoney.GetHashCode();
            }

            if (CashPaidInMoney != null)
            {
                hashCode += CashPaidInMoney.GetHashCode();
            }

            if (CashPaidOutMoney != null)
            {
                hashCode += CashPaidOutMoney.GetHashCode();
            }

            if (ExpectedCashMoney != null)
            {
                hashCode += ExpectedCashMoney.GetHashCode();
            }

            if (ClosedCashMoney != null)
            {
                hashCode += ClosedCashMoney.GetHashCode();
            }

            if (Device != null)
            {
                hashCode += Device.GetHashCode();
            }

            return(hashCode);
        }
Ejemplo n.º 2
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is CashDrawerShift other &&
                   ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) &&
                   ((State == null && other.State == null) || (State?.Equals(other.State) == true)) &&
                   ((OpenedAt == null && other.OpenedAt == null) || (OpenedAt?.Equals(other.OpenedAt) == true)) &&
                   ((EndedAt == null && other.EndedAt == null) || (EndedAt?.Equals(other.EndedAt) == true)) &&
                   ((ClosedAt == null && other.ClosedAt == null) || (ClosedAt?.Equals(other.ClosedAt) == true)) &&
                   ((EmployeeIds == null && other.EmployeeIds == null) || (EmployeeIds?.Equals(other.EmployeeIds) == true)) &&
                   ((OpeningEmployeeId == null && other.OpeningEmployeeId == null) || (OpeningEmployeeId?.Equals(other.OpeningEmployeeId) == true)) &&
                   ((EndingEmployeeId == null && other.EndingEmployeeId == null) || (EndingEmployeeId?.Equals(other.EndingEmployeeId) == true)) &&
                   ((ClosingEmployeeId == null && other.ClosingEmployeeId == null) || (ClosingEmployeeId?.Equals(other.ClosingEmployeeId) == true)) &&
                   ((Description == null && other.Description == null) || (Description?.Equals(other.Description) == true)) &&
                   ((OpenedCashMoney == null && other.OpenedCashMoney == null) || (OpenedCashMoney?.Equals(other.OpenedCashMoney) == true)) &&
                   ((CashPaymentMoney == null && other.CashPaymentMoney == null) || (CashPaymentMoney?.Equals(other.CashPaymentMoney) == true)) &&
                   ((CashRefundsMoney == null && other.CashRefundsMoney == null) || (CashRefundsMoney?.Equals(other.CashRefundsMoney) == true)) &&
                   ((CashPaidInMoney == null && other.CashPaidInMoney == null) || (CashPaidInMoney?.Equals(other.CashPaidInMoney) == true)) &&
                   ((CashPaidOutMoney == null && other.CashPaidOutMoney == null) || (CashPaidOutMoney?.Equals(other.CashPaidOutMoney) == true)) &&
                   ((ExpectedCashMoney == null && other.ExpectedCashMoney == null) || (ExpectedCashMoney?.Equals(other.ExpectedCashMoney) == true)) &&
                   ((ClosedCashMoney == null && other.ClosedCashMoney == null) || (ClosedCashMoney?.Equals(other.ClosedCashMoney) == true)) &&
                   ((Device == null && other.Device == null) || (Device?.Equals(other.Device) == true)));
        }