Esempio n. 1
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

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

            return(obj is Break other &&
                   ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) &&
                   ((StartAt == null && other.StartAt == null) || (StartAt?.Equals(other.StartAt) == true)) &&
                   ((EndAt == null && other.EndAt == null) || (EndAt?.Equals(other.EndAt) == true)) &&
                   ((BreakTypeId == null && other.BreakTypeId == null) || (BreakTypeId?.Equals(other.BreakTypeId) == true)) &&
                   ((Name == null && other.Name == null) || (Name?.Equals(other.Name) == true)) &&
                   ((ExpectedDuration == null && other.ExpectedDuration == null) || (ExpectedDuration?.Equals(other.ExpectedDuration) == true)) &&
                   IsPaid.Equals(other.IsPaid));
        }
Esempio n. 2
0
        public override int GetHashCode()
        {
            int hashCode = 168552180;

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

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

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

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

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

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

            return(hashCode);
        }