public async Task <IHttpActionResult> PutPurchase(string id, Purchase purchase) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != purchase.TransNo) { return(BadRequest()); } try { await _SVC.UpdatePurchase(purchase); } catch (DbUpdateConcurrencyException) { if (!PurchaseExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
async public Task <ActionResult> Update(Purchase item) { return(Content(await _Service.UpdatePurchase(item))); }