Exemplo n.º 1
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)));
        }