public IHttpActionResult GetAll([FromUri] int city_id, [FromUri] int number_of_days_to_get = 2)
        {
            if (city_id == 0)
            {
                return(BadRequest("ERROR_CITY_EMPTY"));
            }

            if (!_cityService.Exist(city_id))
            {
                return(BadRequest("ERROR_CITY_NOT_EXISTS"));
            }

            //i suppose that number_of_days_to_get is the last two days by default
            var result = _deliveryService.GetAll(city_id, number_of_days_to_get);

            return(Ok(result));
        }
 public void Reload()
 {
     Deliveries = DeliveryService.GetAll();
     NotifyOfPropertyChange(() => Deliveries);
 }
Esempio n. 3
0
 public async Task GetAllExecutionContextExpectArgumentNullException()
 {
     await Assert.ThrowsAsync <ArgumentNullException>(async() =>
                                                      await _deliveryService.GetAll(null));
 }