public IActionResult GetById(string id) { try { _repo.GetById(id); return(Ok()); } catch (Exception e) { return(NotFound(e.InnerException.Message)); } }
public IHttpActionResult GetById(int id) { try { var order = _orders.GetById(id); if (order == null) { return(NotFound()); } return(Ok(order)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }