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); }
public static IAlterTableQueryProvider <T> AlterTable <T>(this Migrator Migrator) => Migrator.AlterTable <T>(TableMigratorInfo.FromPoco(typeof(T)).TableName);
public static IAlterTableQueryProvider AlterTable(this Migrator Migrator, Type type) => Migrator.AlterTable(TableMigratorInfo.FromPoco(type).TableName);
public static ICreateTableQueryProvider <T> CreateTable <T>(this Migrator Migrator) => Migrator.CreateTable <T>(TableMigratorInfo.FromPoco(typeof(T)));