Esempio n. 1
0
        public ICreateTableQueryProvider <T> CreateTable <T>(TableMigratorInfo tableInfo)
        {
            checkLastQueryProvider();
            var result = new CreateTableQueryProvider <T>(Database, MigratorSqlSyntaxProvider, tableInfo);

            lastQueryProvider = result;
            return(result);
        }
Esempio n. 2
0
        public ICreateTableQueryProvider CreateTable(Type type, bool autoDetectColumns)
        {
            checkLastQueryProvider();
            var query = new CreateTableQueryProvider(Database, MigratorSqlSyntaxProvider, TableMigratorInfo.FromPoco(type));

            lastQueryProvider = query;
            if (autoDetectColumns)
            {
                var members = type.GetPropertiesAndFields();
                foreach (var member in members)
                {
                    var column = ColumnMigratorInfo.FromMemberInfo(member);
                    if (column != null)
                    {
                        query.AddColumn(column);
                    }
                }
            }
            return(query);
        }
Esempio n. 3
0
 public static IAlterTableQueryProvider <T> AlterTable <T>(this Migrator Migrator)
 => Migrator.AlterTable <T>(TableMigratorInfo.FromPoco(typeof(T)).TableName);
Esempio n. 4
0
 public static IAlterTableQueryProvider AlterTable(this Migrator Migrator, Type type)
 => Migrator.AlterTable(TableMigratorInfo.FromPoco(type).TableName);
Esempio n. 5
0
 public static ICreateTableQueryProvider <T> CreateTable <T>(this Migrator Migrator)
 => Migrator.CreateTable <T>(TableMigratorInfo.FromPoco(typeof(T)));