public override bool Equals(System.Object otherObject1) { if (!(otherObject1 is Object1)) { return(false); } else { Object1 newObject1 = (Object1)otherObject1; bool idEquality = this.GetId() == newObject1.GetId(); bool nameEquality = this.GetName() == newObject1.GetName(); return(idEquality && nameEquality); } }