public async Task <IActionResult> UpdateProduct([FromBody] Inventoryes model) { if (ModelState.IsValid) { try { await _ProductRepositories.UpdateProduct(model); return(Ok()); } catch (Microsoft.EntityFrameworkCore.DbUpdateConcurrencyException ex) { if (ex.GetType().FullName == "Microsoft.EntityFrameworkCore.DbUpdateConcurrencyException") { return(NotFound()); } return(BadRequest()); } } return(BadRequest()); }