public override int GetHashCode() { //Get hash code for the Name field if it is not null. int hashSourceOfIncomeId = SourceOfIncomeId == null ? 0 : SourceOfIncomeId.GetHashCode(); //Get hash code for the Code field. //int hashProductCode = Code.GetHashCode(); //Calculate the hash code for the product. return(hashSourceOfIncomeId); }
public bool Equals(Income 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(SourceOfIncomeId.Equals(other.SourceOfIncomeId)); }