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