public override bool Equals(object?obj) { if (this == obj) { return(true); } Job helper = obj as Job; return(JobTitle.Equals(helper.JobTitle) && Salary == helper.Salary); }
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); }
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))); }