Exemplo n.º 1
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                var hashCode = 41;
                // Suitable nullity checks etc, of course :)
                if (NombreProveedor != null)
                {
                    hashCode = hashCode * 59 + NombreProveedor.GetHashCode();
                }
                if (Identificacion != null)
                {
                    hashCode = hashCode * 59 + Identificacion.GetHashCode();
                }
                if (TipoConvenio != null)
                {
                    hashCode = hashCode * 59 + TipoConvenio.GetHashCode();
                }
                if (FechaVigencia != null)
                {
                    hashCode = hashCode * 59 + FechaVigencia.GetHashCode();
                }
                if (Correo != null)
                {
                    hashCode = hashCode * 59 + Correo.GetHashCode();
                }

                /*if (Pais != null)
                 * hashCode = hashCode * 59 + Pais.GetHashCode();*/
                if (Ciudad != null)
                {
                    hashCode = hashCode * 59 + Ciudad.GetHashCode();
                }
                if (Endpoint != null)
                {
                    hashCode = hashCode * 59 + Endpoint.GetHashCode();
                }
                if (TemplateEntrada != null)
                {
                    hashCode = hashCode * 59 + TemplateEntrada.GetHashCode();
                }
                if (TemplateSalida != null)
                {
                    hashCode = hashCode * 59 + TemplateSalida.GetHashCode();
                }
                if (EstadoConvenio != null)
                {
                    hashCode = hashCode * 59 + EstadoConvenio.GetHashCode();
                }
                return(hashCode);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Returns true if Convenio instances are equal
        /// </summary>
        /// <param name="other">Instance of Convenio to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Convenio other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     NombreProveedor == other.NombreProveedor ||
                     NombreProveedor != null &&
                     NombreProveedor.Equals(other.NombreProveedor)
                     ) &&
                 (
                     Identificacion == other.Identificacion ||
                     Identificacion != null &&
                     Identificacion.Equals(other.Identificacion)
                 ) &&
                 (
                     TipoConvenio == other.TipoConvenio ||
                     TipoConvenio != null &&
                     TipoConvenio.Equals(other.TipoConvenio)
                 ) &&
                 (
                     FechaVigencia == other.FechaVigencia ||
                     FechaVigencia != null &&
                     FechaVigencia.Equals(other.FechaVigencia)
                 ) &&
                 (
                     Correo == other.Correo ||
                     Correo != null &&
                     Correo.Equals(other.Correo)
                 ) /*&&
                    * (
                    * Pais == other.Pais ||
                    * Pais != null &&
                    * Pais.Equals(other.Pais)
                    * ) */&&
                 (
                     Ciudad == other.Ciudad ||
                     Ciudad != null &&
                     Ciudad.Equals(other.Ciudad)
                 ) &&
                 (
                     Endpoint == other.Endpoint ||
                     Endpoint != null &&
                     Endpoint.Equals(other.Endpoint)
                 ) &&
                 (
                     TemplateEntrada == other.TemplateEntrada ||
                     TemplateEntrada != null &&
                     TemplateEntrada.Equals(other.TemplateEntrada)
                 ) &&
                 (
                     TemplateSalida == other.TemplateSalida ||
                     TemplateSalida != null &&
                     TemplateSalida.Equals(other.TemplateSalida)
                 ) &&
                 (
                     EstadoConvenio == other.EstadoConvenio ||
                     EstadoConvenio != null &&
                     EstadoConvenio.Equals(other.EstadoConvenio)
                 ));
        }