Exemplo n.º 1
0
        /// <summary>
        ///     Determines whether the specified <see cref="EntityRelationship&lt;TEntity&gt;" /> is equal to this instance.
        /// </summary>
        /// <param name="obj">
        ///     The <see cref="EntityRelationship&lt;TEntity&gt;" /> to compare with this instance.
        /// </param>
        /// <returns>
        ///     <c>true</c> if the specified <see cref="EntityRelationship&lt;TEntity&gt;" /> is equal to this instance; otherwise, <c>false</c>.
        /// </returns>
        public bool Equals(EntityRelationship <TEntity> obj)
        {
            if (( object )obj == null)
            {
                return(false);
            }

            return(this == obj);
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Checks the entity equality.
        /// </summary>
        /// <param name="a">A.</param>
        /// <param name="b">The b.</param>
        /// <returns>
        ///     True if the entities are the same; false otherwise.
        /// </returns>
        private static bool CheckEntity(EntityRelationship <TEntity> a, EntityRelationship <TEntity> b)
        {
            if (a.Entity == null)
            {
                if (b.Entity != null)
                {
                    return(false);
                }
            }
            else
            {
                if (b.Entity == null)
                {
                    return(false);
                }

                if (!a.Entity.Equals(b.Entity))
                {
                    return(false);
                }
            }

            return(true);
        }