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

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

            return false;
        }

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

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