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

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

            return false;
        }

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