public IActionResult GetById(int id) { if (id == 0) { return(BadRequest()); } var userFound = userBLL.Find(id); if (userFound == null) { return(NotFound()); } return(new ObjectResult(userFound)); }
private User GetUser(int userId) { try { return(userBll.Find(userId)); } catch (Exception ex) { throw new Exception(ex.Message); } }