public IActionResult Get(bool includeItems = true) { try { var username = User.Identity.Name; var result = _repository.GetAllOrdersByUser(username, includeItems); return(Ok(_mapper.Map <IEnumerable <Order>, IEnumerable <OrderViewModel> >(result))); } catch (Exception ex) { _logger.LogError($"Failed to get Orders {ex}"); return(BadRequest("Failed to get orders result")); } }