// [ValidateAntiForgeryToken] public async Task <IActionResult> Edit(int?id, [FromBody] Customer customer) { // if (id != customer.Id) // { // return NotFound(); // } if (ModelState.IsValid) { try { _context.Update(customer); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CustomerExists(customer.Id)) { return(NotFound()); } else { throw; } } return(Ok()); } return(ValidationProblem()); }
// [ValidateAntiForgeryToken] public async Task <IActionResult> Edit(int?id, [FromBody] Sales Sale) { // if (id != Sale.Id) // { // return NotFound(); // } if (ModelState.IsValid) { try { //Sale.Datesold = DateTime.Now; _context.Update(Sale); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SaleExists(Sale.Id)) { return(NotFound()); } else { throw; } } return(Ok()); } return(ValidationProblem()); }