예제 #1
0
        public static bool StructureEquals(AstTableKeyBaseNode key1, AstTableKeyBaseNode key2)
        {
            if (key1 == null || key2 == null)
            {
                return(key1 == null && key2 == null);
            }

            bool match = true;

            match &= key1.GetType().Equals(key2.GetType());
            match &= key1.Clustered == key2.Clustered;
            match &= key1.IgnoreDupKey == key2.IgnoreDupKey;
            match &= key1.PadIndex == key2.PadIndex;
            match &= key1.Unique == key2.Unique;
            match &= key1.Columns.Count == key2.Columns.Count;

            if (match)
            {
                for (int i = 0; i < key1.Columns.Count; i++)
                {
                    match &= AstTableKeyColumnNode.StructureEquals(key1.Columns[i], key2.Columns[i]);
                }
            }

            return(match);
        }
예제 #2
0
        public static bool StructureEquals(AstTableKeyColumnNode keyColumn1, AstTableKeyColumnNode keyColumn2)
        {
            if (keyColumn1 == null || keyColumn2 == null)
            {
                return keyColumn1 == null && keyColumn2 == null;
            }

            bool match = true;
            match &= keyColumn1.SortOrder == keyColumn2.SortOrder;
            match &= keyColumn1.Column == keyColumn2.Column;
            return match;
        }
예제 #3
0
        public static bool StructureEquals(AstTableKeyColumnNode keyColumn1, AstTableKeyColumnNode keyColumn2)
        {
            if (keyColumn1 == null || keyColumn2 == null)
            {
                return(keyColumn1 == null && keyColumn2 == null);
            }

            bool match = true;

            match &= keyColumn1.SortOrder == keyColumn2.SortOrder;
            match &= keyColumn1.Column == keyColumn2.Column;
            return(match);
        }