public override bool Equals(System.Object otherCategory) { if (!(otherCategory is Category)) { return(false); } else { Category newCategory = (Category)otherCategory; bool idEquality = (this.GetId() == newCategory.GetId()); bool descriptionEquality = (this.GetDescription() == newCategory.GetDescription()); return(idEquality && descriptionEquality); } }