问题
I have UWP app which downloads data from woocomerce.
RestAPI rest = new RestAPI("http://simplegames.com.ua/wp-json/wc/v1/", "ck_9d64c027d2c5f81b8bed3342eeccc6d337be813d", "cs_60697b1e6cbdeb8d62d19e0765e339f8e3334754");
WCObject wc = new WCObject(rest);
//Get all products
var products = await wc.GetOrders();
Debug.WriteLine(products);
I try to display data to Console.
Debug shows name of method, how I can show data that I downloaded?
回答1:
So, let's start
//Get all products
var products = await wc.GetOrders();
You retrieve OrderList
object type, which derives from List<Order>
. It means, that you need get data per each item
foreach (var order in products)
{
}
In order
item you have all required data, which you need. For example:
Debug.WriteLine($"Currency: {order.currency}, Total Tax: {order.total_tax}");
I hope, you will find way how retrieve other data from order
item
来源:https://stackoverflow.com/questions/38918908/how-to-display-data-from-woocomerce-api-call