示例#1
0
 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);
     }
 }