public override bool Equals(object obj) { if (obj is ComplexObject) { var item = obj as ComplexObject; return item.SomeInt32Property == this.SomeInt32Property && item.SomeTextProperty == this.SomeTextProperty; } return false; }