コード例 #1
0
        public static void CreateObject(this IAlterProcessor proc, IAbstractObjectStructure obj)
        {
            var tbl = obj as ITableStructure;

            if (tbl != null)
            {
                proc.CreateTable(tbl);
                return;
            }
            var col = obj as IColumnStructure;

            if (col != null)
            {
                proc.CreateColumn(col);
                return;
            }
            var cnt = obj as IConstraint;

            if (cnt != null)
            {
                proc.CreateConstraint(cnt);
                return;
            }
            var spe = obj as ISpecificObjectStructure;

            if (spe != null)
            {
                proc.CreateSpecificObject(spe);
                return;
            }
            var sch = obj as ISchemaStructure;

            if (sch != null)
            {
                proc.CreateSchema(sch);
                return;
            }
            var dom = obj as IDomainStructure;

            if (dom != null)
            {
                proc.CreateDomain(dom);
                return;
            }
        }
コード例 #2
0
        public static void CreateObject(this IAlterProcessor proc, DatabaseObjectInfo obj)
        {
            var tbl = obj as TableInfo;

            if (tbl != null)
            {
                proc.CreateTable(tbl);
                return;
            }
            var col = obj as ColumnInfo;

            if (col != null)
            {
                proc.CreateColumn(col);
                return;
            }
            var cnt = obj as ConstraintInfo;

            if (cnt != null)
            {
                proc.CreateConstraint(cnt);
                return;
            }
            var spe = obj as SpecificObjectInfo;

            if (spe != null)
            {
                proc.CreateSpecificObject(spe);
                return;
            }
            //var sch = obj as ISchemaStructure;
            //if (sch != null)
            //{
            //    proc.CreateSchema(sch);
            //    return;
            //}
            //var dom = obj as IDomainStructure;
            //if (dom != null)
            //{
            //    proc.CreateDomain(dom);
            //    return;
            //}
        }