Пример #1
0
        public ICreateTableQueryProvider <T> CreateTable <T>(TableMigratorInfo tableInfo)
        {
            checkLastQueryProvider();
            var result = new CreateTableQueryProvider <T>(Database, MigratorSqlSyntaxProvider, tableInfo);

            lastQueryProvider = result;
            return(result);
        }
Пример #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);
        }
Пример #3
0
 public static IAlterTableQueryProvider <T> AlterTable <T>(this Migrator Migrator)
 => Migrator.AlterTable <T>(TableMigratorInfo.FromPoco(typeof(T)).TableName);
Пример #4
0
 public static IAlterTableQueryProvider AlterTable(this Migrator Migrator, Type type)
 => Migrator.AlterTable(TableMigratorInfo.FromPoco(type).TableName);
Пример #5
0
 public static ICreateTableQueryProvider <T> CreateTable <T>(this Migrator Migrator)
 => Migrator.CreateTable <T>(TableMigratorInfo.FromPoco(typeof(T)));