Exemplo n.º 1
0
        public async Task <IHttpActionResult> PutOrder(string id, Order order)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != order.TransNo)
            {
                return(BadRequest());
            }

            try
            {
                await _SVC.UpdateOrder(order);
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!OrderExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Exemplo n.º 2
0
 async public Task <ActionResult> Update(Order item)
 {
     return(Content(await _Service.UpdateOrder(item)));
 }