diff --git a/angel_orm_generator/test/example/car_controller.dart b/angel_orm_generator/test/example/car_controller.dart new file mode 100644 index 00000000..0919e30a --- /dev/null +++ b/angel_orm_generator/test/example/car_controller.dart @@ -0,0 +1,18 @@ +import 'dart:async'; +import 'package:angel_framework/angel_framework.dart'; +import 'package:postgres/postgres.dart'; +import '../models/car.dart'; +import '../models/car.orm.g.dart'; + +@Expose('/api/cars') +class CarController extends Controller { + @Expose('/luxury') + Stream getLuxuryCars(PostgreSQLConnection connection) { + var query = new CarQuery(); + query.where + ..familyFriendly.equals(false) + ..createdAt.year.greaterThanOrEqualTo(2014) + ..make.isIn(['Ferrari', 'Lamborghini', 'Mustang', 'Lexus']); + return query.get(connection); + } +}