Ejemplo n.º 1
0
 public ActionResult <Burger> Create([FromBody] Burger newBurger) // req.body
 {
     try {
         return(Ok(_service.Create(newBurger)));
     } catch (Exception e) {
         return(BadRequest(e.Message));
     }
 }
Ejemplo n.º 2
0
 public ActionResult <Burger> Create([FromBody] Burger newBurger)
 {
     try
     {
         return(Ok(_bs.Create(newBurger)));
     }
     catch (System.Exception err)
     {
         return(BadRequest(err));
     }
 }
 public ActionResult <Burger> Create([FromBody] Burger burger)
 {
     try
     {
         return(Ok(_bs.Create(burger)));
     }
     catch (System.Exception e)
     {
         return(BadRequest(e.Message));
     }
 }