public IActionResult GetUserByID(int userId) { try { UserModel user = dbAccessor.GetUserById(userId); if (user == null) { return(NotFound()); } else { return(Ok(user)); } } catch (Exception ex) { return(NotFound(ex)); } }