public async Task <List <CartItem> > GetCartItems(int userId) { _restResponse = await _rest.GetRequest("v1/my-cart/" + userId + "/items"); var cartItemList = ObjectBuilder.BuildCartItemList(_restResponse); return(cartItemList); }
private static async void GetCartItems(int userId) { IRestResponse restResponse = await _rest.GetRequest($"v1/my-cart/{userId}/items"); if (restResponse != null) { List <CartItem> cartItemList = ObjectBuilder.BuildCartItemList(restResponse); if (cartItemList != null) { foreach (var cartItem in cartItemList) { Console.WriteLine(cartItem.ITEM_PRICE); } } Console.WriteLine("Press any key to exit"); } }