Ejemplo n.º 1
0
        /// <summary>
        /// Returns true if Carro instances are equal
        /// </summary>
        /// <param name="other">Instance of Carro to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Carro other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Placa == other.Placa ||
                     Placa != null &&
                     Placa.Equals(other.Placa)
                     ) &&
                 (
                     Descricao == other.Descricao ||
                     Descricao != null &&
                     Descricao.Equals(other.Descricao)
                 ) &&
                 (
                     Loja == other.Loja ||
                     Loja != null &&
                     Loja.Equals(other.Loja)
                 ));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns true if Reserva instances are equal
        /// </summary>
        /// <param name="other">Instance of Reserva to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Reserva other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Localizador == other.Localizador ||
                     Localizador != null &&
                     Localizador.Equals(other.Localizador)
                     ) &&
                 (
                     Placa == other.Placa ||
                     Placa != null &&
                     Placa.Equals(other.Placa)
                 ) &&
                 (
                     IdCliente == other.IdCliente ||
                     IdCliente != null &&
                     IdCliente.Equals(other.IdCliente)
                 ) &&
                 (
                     Loja == other.Loja ||
                     Loja != null &&
                     Loja.Equals(other.Loja)
                 ) &&
                 (
                     Status == other.Status ||
                     Status != null &&
                     Status.Equals(other.Status)
                 ) &&
                 (
                     IdPagamento == other.IdPagamento ||
                     IdPagamento != null &&
                     IdPagamento.Equals(other.IdPagamento)
                 ));
        }