Example #1
0
        public column get_column_fk_parent(column c)
        {
            if (null == c.fk)
            {
                return(null);
            }
            database FK_D = data_set.SingleOrDefault(x => x.name == c.fk.db);

            if (FK_D == null)
            {
                return(null);                                                               //no DB?
            }
            table FK_T = FK_D.tables.SingleOrDefault(x => x.name == c.fk.table);

            if (FK_T == null)
            {
                return(null);                                                               //no Table
            }
            column FK_C = FK_T.columns.SingleOrDefault(x => x.name == c.fk.column);

            if (FK_C == null)
            {
                return(null);                                                               //no column?
            }
            return(FK_C);                                                                   //return the destination Column
        }
Example #2
0
        public database get_database_fk_parent(column c)
        {
            if (null == c.fk)
            {
                return(null);
            }
            database FK_D = data_set.SingleOrDefault(x => x.name == c.fk.db);

            if (FK_D == null)
            {
                return(null);                                                               //no DB?
            }
            return(FK_D);                                                                   //return the destination Column
        }
Example #3
0
        public table get_table_fk_parent(column c)
        {
            if (null == c.fk)
            {
                return(null);
            }
            database FK_D = data_set.SingleOrDefault(x => x.name == c.fk.db);

            if (FK_D == null)
            {
                return(null);                                                               //no DB?
            }
            table FK_T = FK_D.tables.SingleOrDefault(x => x.name == c.fk.table);

            if (FK_T == null)
            {
                return(null);                                                               //no Table
            }
            return(FK_T);                                                                   //return the destination Column
        }