Ejemplo n.º 1
0
        public async ValueTask <RequestResult <List <Order> > > OrderGetByCustomerId(int id)
        {
            var result = new RequestResult <List <Order> >();

            try
            {
                result.RequestData = await _storage.OrderGetByCustomerId(id);

                foreach (var order in result.RequestData)
                {
                    order.OrderItems = await _storage.OrderProductsGetByOrderId((int)order.Id);
                }
                result.IsOkay = true;
            }
            catch (Exception ex)
            {
                result.ExMessage = ex.Message;
            }
            return(result);
        }