public async Task <IHttpActionResult> Patch([FromODataUri] int PaymentMethodID, Delta <PaymentMethod> patch) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var item = await _service.FindAsync(PaymentMethodID); if (item == null) { return(NotFound()); } patch.Patch(item); item.ObjectState = ObjectState.Modified; try { await _unitOfWorkAsync.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ItemExists(PaymentMethodID)) { return(NotFound()); } throw; } return(Updated(item)); }