Example #1
0
 public ActionResult <Ingredient> Edit([FromBody] Ingredient updated, int id)
 {
     try
     {
         updated.Id = id;
         return(Ok(_service.Edit(updated)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Example #2
0
 public ActionResult <Ingredient> Edit([FromBody] Ingredient editIngredient, int id)
 {
     try
     {
         editIngredient.Id = id;
         return(Ok(_service.Edit(editIngredient)));
     }
     catch (System.Exception e)
     {
         return(BadRequest(e.Message));
     }
 }