Example #1
0
        public async Task <IHttpActionResult> AddDelivery([FromBody] UpdateDeliveryRequest createRequest)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var delivery = await _deliveryService.CreateDeliveryAsync(createRequest);

            var location = string.Format("/api/deliveries/{0}", delivery.OrderId);

            return(Created <Delivery>(location, delivery));
        }