예제 #1
0
        public override bool Equals(object?obj)
        {
            if (this == obj)
            {
                return(true);
            }
            Job helper = obj as Job;

            return(JobTitle.Equals(helper.JobTitle) && Salary == helper.Salary);
        }
예제 #2
0
        public override bool Equals(object obj)
        {
            var result = false;

            if (obj != null && obj.GetType() == typeof(Employee))
            {
                var that = (Employee)obj;
                result =
                    Id.Equals(that.Id) &&
                    Name.Equals(that.Name) &&
                    JobTitle.Equals(that.JobTitle) &&
                    EmailAddress.Equals(that.EmailAddress) &&
                    ManagerId.Equals(that.ManagerId);
            }
            return(result);
        }
예제 #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)));
        }