Beispiel #1
0
        public static void RemoveTableMapping(TableModel table)
        {
            string tableNameKey = table.TableName.ToLower();

            if (table.Columns.HasElements())
            {
                foreach (ColumnObjectModel column in table.Columns)
                {
                    Integrity.RemoveColumnMapping(column, table.TableName);
                }
            }

            if (!Integrity.tableColumns.ContainsKey(tableNameKey))
            {
                Integrity.tableColumns.Remove(tableNameKey);
            }

            if (!Integrity.tableMasterList.Any(t => t.ToLower() == tableNameKey))
            { // NOTE: We check case but dont use it
                Integrity.tableMasterList.Remove(table.TableName);
            }
        }
Beispiel #2
0
        public static void MapTable(TableModel table)
        {
            string tableNameKey = table.TableName.ToLower();

            if (!Integrity.tableMasterList.Any(t => t.ToLower() == tableNameKey))
            { // NOTE: We check case but dont use it
                Integrity.tableMasterList.Add(table.TableName);
            }

            if (!Integrity.tableColumns.ContainsKey(tableNameKey))
            {
                Integrity.tableColumns.Add(tableNameKey, new List <string>());
            }

            if (!table.Columns.HasElements())
            { // Nothing to do futher
                return;
            }

            foreach (ColumnObjectModel column in table.Columns)
            {
                Integrity.MapColumn(column, table.TableName);
            }
        }