namespace BS.Shared.DataContracts
{
    public partial class EmploymentTypeDC
    {
        public override bool Equals(object obj)
        {
            if (obj is EmploymentTypeDC)
            {
                var y = (EmploymentTypeDC)obj;
                if (this.EmploymentTypeOid == null && y.EmploymentTypeOid == null)
                {
                    return this.GetHashCode() == y.GetHashCode();
                }

                if (this.EmploymentTypeOid != null && y.EmploymentTypeOid != null)
                {
                    return this.EmploymentTypeOid == y.EmploymentTypeOid;
                }
            }

            return false;
        }

        public override int GetHashCode()
        {
            return this.EmploymentTypeOid.HasValue ? this.GetType().Name.GetHashCode() ^ this.EmploymentTypeOid.GetHashCode() : base.GetHashCode();
        }

        public override string ToString()
        {
            return Name;
        }
    }
}