public IActionResult Get(int orderId)
        {
            var order = _repository.GetOrderById(User.Identity.Name, orderId);

            if (order != null)
            {
                return(Ok(_mapper.Map <IEnumerable <OrderItem>, IEnumerable <OrderItemViewModel> >(order.Items)));
            }
            return(NotFound());
        }
        public IActionResult Get(int id)
        {
            try
            {
                var order = _repository.GetOrderById(User.Identity.Name, id);

                if (order != null)
                {
                    return(Ok(_mapper.Map <Order, OrderViewModel>(order)));
                }
                else
                {
                    return(NotFound());
                }
            }
            catch
            {
                return(BadRequest("failed to return all orders"));
            }
        }