public IActionResult Get(int id) { try { var order = _repository.GetOrderById(id); if (order != null) { return(Ok(order)); } else { return(NotFound()); } } catch (Exception ex) { _logger.LogError($"Failed to get orders: {ex}"); return(BadRequest("FAiled to get Orders")); } }