public bool Equals(CourseTrainer other) { if (ReferenceEquals(other, null)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(CourseId.Equals(other.CourseId) && TrainerId.Equals(other.TrainerId)); }