public override int GetHashCode() { //Get hash code for the Name field if it is not null. int hashCostsCategorId = CostCategoriesId == null ? 0 : CostCategoriesId.GetHashCode(); //Get hash code for the Code field. //int hashProductCode = Code.GetHashCode(); //Calculate the hash code for the product. return(hashCostsCategorId); }
public bool Equals(Costs other) { //Check whether the compared object is null. if (Object.ReferenceEquals(other, null)) { return(false); } //Check whether the compared object references the same data. if (Object.ReferenceEquals(this, other)) { return(true); } //Check whether the products' properties are equal. return(CostCategoriesId.Equals(other.CostCategoriesId)); }