// GET: Burgers/Details/5
        public IActionResult Details(int id)
        {
            var burger = _bs.GetById(id);

            if (burger == null)
            {
                return(NotFound());
            }

            return(View(burger));
        }
 public ActionResult <Burger> Get(int id)
 {
     try
     {
         return(Ok(_bs.GetById(id)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Пример #3
0
 public ActionResult <Burger> GetById(int id)
 {
     try
     {
         return(Ok(_burgersService.GetById(id)));
     }
     catch (System.Exception err)
     {
         return(BadRequest(err.Message));
     }
 }