public IActionResult Get(int id) { try { var list = _service.GetById(id); if (list == null) { return(NotFound()); } return(Ok(list)); } catch (Exception e) { Console.WriteLine(e); return(BadRequest($"{e.Message}")); } }
public IActionResult Edit(int id) { var result = _service.GetById(id); return(View(result)); }