Biblioteca.Dominio.Livro.Equals C# (CSharp) Method

Equals() public method

public Equals ( Livro outro ) : bool
outro Livro
return bool
        public bool Equals(Livro outro)
            {
                // If parameter is null, return false. 
                if (Object.ReferenceEquals(outro, null))
                {
                    return false;
                }

                // Optimization for a common success case. 
                if (Object.ReferenceEquals(this, outro))
                {
                    return true;
                }

                // If run-time types are not exactly the same, return false. 
                if (this.GetType() != outro.GetType())
                    return false;

                // Return true if the fields match. 
                // Note that the base class is not invoked because it is 
                // System.Object, which defines Equals as reference equality. 
                return (outro.LivroId == this.LivroId);
            }

Same methods

Livro::Equals ( object obj ) : bool