public bool Equals(
            IEnumerable <PropertyInfo> x,
            IEnumerable <PropertyInfo> y)
        {
            if (ReferenceEquals(x, y))
            {
                return(true);
            }

            if (x == null ||
                y == null)
            {
                return(false);
            }

            var comparer = new PropertyInfoComparer();

            foreach (var prop in x)
            {
                if (!y.Any(item =>
                           comparer.Equals(
                               item,
                               prop)))
                {
                    return(false);
                }
            }

            return(true);
        }
Пример #2
0
        public bool Equals(
            ReferenceInfo x,
            ReferenceInfo y)
        {
            bool result = base.Equals(x, y);

            var entityComparer   = new EntityInfoComparer();
            var propertyComparer = new PropertyInfoComparer();

            if (x.ForeignKey != y.ForeignKey ||
                !propertyComparer.Equals(
                    x.Property,
                    y.Property) ||
                !entityComparer.Equals(
                    x.Reference,
                    y.Reference))
            {
                return(false);
            }

            return(result);
        }