示例#1
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);
        }
示例#2
0
 public static IAlterTableQueryProvider <T> AlterTable <T>(this Migrator Migrator)
 => Migrator.AlterTable <T>(TableMigratorInfo.FromPoco(typeof(T)).TableName);
示例#3
0
 public static IAlterTableQueryProvider AlterTable(this Migrator Migrator, Type type)
 => Migrator.AlterTable(TableMigratorInfo.FromPoco(type).TableName);
示例#4
0
 public static ICreateTableQueryProvider <T> CreateTable <T>(this Migrator Migrator)
 => Migrator.CreateTable <T>(TableMigratorInfo.FromPoco(typeof(T)));