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 IAlterTableColumnQueryProvider AddColumn <T>(this IAlterTableQueryProvider provider, Expression <Func <T, object> > expression) { var member = expression.GetMember(); return(provider.AddColumn(ColumnMigratorInfo.FromMemberInfo(member))); }