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