public ActionResult ShoeUpdate(ShoeModel shoe) { if (ModelState.IsValid) { _service.UpdateShoe(shoe); return(RedirectToAction("ShoeIndex")); } return(View()); }
public ActionResult <Shoe> Put(int id, [FromBody] Shoe shoe) { try { return(Ok(_shoeService.UpdateShoe(shoe))); } catch (Exception e) { return(BadRequest(e.Message)); } }