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

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

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

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

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

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

            return(hashCode);
        }
Ejemplo n.º 2
0
 protected void ToString(List <string> toStringOutput)
 {
     toStringOutput.Add($"JobTitle = {(JobTitle == null ? "null" : JobTitle == string.Empty ? "" : JobTitle)}");
     toStringOutput.Add($"PayType = {(PayType == null ? "null" : PayType.ToString())}");
     toStringOutput.Add($"HourlyRate = {(HourlyRate == null ? "null" : HourlyRate.ToString())}");
     toStringOutput.Add($"AnnualRate = {(AnnualRate == null ? "null" : AnnualRate.ToString())}");
     toStringOutput.Add($"WeeklyHours = {(WeeklyHours == null ? "null" : WeeklyHours.ToString())}");
 }
Ejemplo n.º 3
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

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

            return(obj is JobAssignment other &&
                   ((JobTitle == null && other.JobTitle == null) || (JobTitle?.Equals(other.JobTitle) == true)) &&
                   ((PayType == null && other.PayType == null) || (PayType?.Equals(other.PayType) == true)) &&
                   ((HourlyRate == null && other.HourlyRate == null) || (HourlyRate?.Equals(other.HourlyRate) == true)) &&
                   ((AnnualRate == null && other.AnnualRate == null) || (AnnualRate?.Equals(other.AnnualRate) == true)) &&
                   ((WeeklyHours == null && other.WeeklyHours == null) || (WeeklyHours?.Equals(other.WeeklyHours) == true)));
        }