public override bool Equals(object obj) { if (!(obj is Good4)) { return(false); } Good4 rhs = (Good4)obj; // cast is OK when paired with isinst return(State == rhs.State); }
public override bool Equals(object obj) { Good4 rhs = obj as Good4; if ((object)rhs == null) { return(false); } return(name == rhs.name && address == rhs.address); }
public override bool Equals(object rhsObj) { if (rhsObj == null) { return(false); } Good4 rhs = rhsObj as Good4; return(FirstName == rhs.FirstName && LastName == rhs.LastName); }
public override bool Equals(object rhsObj) { if (rhsObj == null) { return(false); } Good4 rhs = rhsObj as Good4; return(this == rhs); }
public bool DoEquals(Good4 rhs) { if (object.ReferenceEquals(this, rhs)) { return(true); } if ((object)rhs == null) { return(false); } return(address == rhs.address); // does not match GetHashCode but we cant catch it }
// Equals calls a helper public bool Equals(Good4 rhs) { return DoEquals(rhs); }
public bool DoEquals(Good4 rhs) { if (object.ReferenceEquals(this, rhs)) return true; if ((object) rhs == null) return false; return address == rhs.address; // does not match GetHashCode but we cant catch it }
// Equals calls a helper public bool Equals(Good4 rhs) { return(DoEquals(rhs)); }