public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (ReferenceEquals(this, obj))
            {
                return(true);
            }

            var other = obj as DependencyConfig;

            if (other == null)
            {
                return(false);
            }


            return(DependencyID == other.DependencyID &&
                   RegionPrefix.Equals(
                       other.RegionPrefix,
                       StringComparison.Ordinal));
        }
Example #2
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (ReferenceEquals(this, obj))
            {
                return(true);
            }

            var other = obj as QueryTableDependencyConfiguration;

            if (other == null)
            {
                return(false);
            }

            if (!QualifiedTableName.Equals(
                    other.QualifiedTableName,
                    StringComparison.Ordinal))
            {
                return(false);
            }

            if (!RegionPrefix.Equals(
                    other.RegionPrefix,
                    StringComparison.Ordinal))
            {
                return(false);
            }

            if (IsPollingDependencyUsed != other.IsPollingDependencyUsed)
            {
                return(false);
            }

            if (DatabaseType != other.DatabaseType)
            {
                return(false);
            }

            return(true);
        }
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (ReferenceEquals(this, obj))
            {
                return(true);
            }

            var other = obj as QueryCommandDependencyConfiguration;

            if (other == null)
            {
                return(false);
            }

            if (!QualifiedTableName.Equals(
                    other.QualifiedTableName,
                    StringComparison.Ordinal))
            {
                return(false);
            }

            if (!RegionPrefix.Equals(
                    other.RegionPrefix,
                    StringComparison.Ordinal))
            {
                return(false);
            }

            if (IsPollingDependencyUsed != other.IsPollingDependencyUsed)
            {
                return(false);
            }

            if (DatabaseType != other.DatabaseType)
            {
                return(false);
            }

            if (KeyColumnNames == null && other.KeyColumnNames != null)
            {
                return(false);
            }

            if (KeyColumnNames != null && other.KeyColumnNames == null)
            {
                return(false);
            }

            var keyColumn1 =
                new HashSet <string>(KeyColumnNames).Select(x => x.Trim()).ToArray();
            var keyColumn2 =
                new HashSet <string>(other.KeyColumnNames).Select(x => x.Trim()).ToArray();

            if (keyColumn1.Length != keyColumn2.Length)
            {
                return(false);
            }

            foreach (var keyColumnName in keyColumn1)
            {
                if (!keyColumn2.Contains(
                        keyColumnName))
                {
                    return(false);
                }
            }

            return(true);
        }