public async Task <IActionResult> PutReceipt(int id, Receipt receipt) { if (id != receipt.ReceiptId) { return(BadRequest()); } _context.Entry(receipt).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ReceiptExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }