예제 #1
0
 protected bool Equals(Employee other)
 {
     return(String.Equals(Id, other.Id, StringComparison.InvariantCultureIgnoreCase) &&
            String.Equals(CompanyId, other.CompanyId, StringComparison.InvariantCultureIgnoreCase) &&
            String.Equals(CompanyName, other.CompanyName, StringComparison.InvariantCultureIgnoreCase) &&
            String.Equals(Name, other.Name, StringComparison.InvariantCultureIgnoreCase) &&
            Age == other.Age &&
            YearsEmployed == other.YearsEmployed &&
            LastReview.Equals(other.LastReview) &&
            CreatedUtc.Equals(other.CreatedUtc) &&
            UpdatedUtc.Equals(other.UpdatedUtc) &&
            Version == other.Version);
 }
예제 #2
0
 public override int GetHashCode()
 {
     unchecked {
         var hashCode = (Id != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(Id) : 0);
         hashCode = (hashCode * 397) ^ (CompanyId != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(CompanyId) : 0);
         hashCode = (hashCode * 397) ^ (CompanyName != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(CompanyName) : 0);
         hashCode = (hashCode * 397) ^ (Name != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(Name) : 0);
         hashCode = (hashCode * 397) ^ Age;
         hashCode = (hashCode * 397) ^ YearsEmployed;
         hashCode = (hashCode * 397) ^ LastReview.GetHashCode();
         hashCode = (hashCode * 397) ^ CreatedUtc.GetHashCode();
         hashCode = (hashCode * 397) ^ UpdatedUtc.GetHashCode();
         hashCode = (hashCode * 397) ^ Version.GetHashCode();
         return(hashCode);
     }
 }