コード例 #1
0
        public CarQuery(ICarDatabase db)
        {
            this.db = db;

            Field <ListGraphType <CarGraphType> >("cars", "Query to retrieve all cars",
                                                  resolve: GetAllCars);

            Field <CarGraphType>("car", "Query to retrieve a specific car",
                                 new QueryArguments(MakeNonNullStringArgument("registration", "The registration (licence plate) of the car")),
                                 resolve: GetCar);

            Field <ListGraphType <CarGraphType> >("carsByColor", "Query to retrieve all cars matching the specified color",
                                                  new QueryArguments(MakeNonNullStringArgument("color", "The name of a color, eg 'blue', 'grey'")),
                                                  resolve: GetCarsByColor);
        }
コード例 #2
0
 public CarsController(ICarDatabase database, ILogger <CarsController> logger)
 {
     this.database = database;
     this.logger   = logger;
 }
コード例 #3
0
 public AutobarnSchema(ICarDatabase db) => Query = new CarQuery(db);
コード例 #4
0
 public CarsController(ICarDatabase db, IBus bus)
 {
     this.db  = db;
     this.bus = bus;
 }
コード例 #5
0
 public CarModelsController(ICarDatabase db)
 {
     this.db = db;
 }