Exemplo n.º 1
0
 private void btnCreateOrder_Click(object sender, RoutedEventArgs e)
 {
     IRestService proxy = CreateProxy();
     int numberOfItems = int.Parse(this.txtNumberOfItems.Text);
     Order order = new Order();
     order.Processed = true;
     order.Items = new List<OrderItem>();
     for (int i = 0; i < numberOfItems; i++)
     {
         OrderItem item = new OrderItem();
         item.Amount = i + 1;
         item.Product = new Product
         {
             ID = i,
             Name = "Product " + i,
         };
         order.Items.Add(item);
     }
     proxy.BeginCreateOrder(order, new AsyncCallback(CreateOrderCompleted), proxy);
 }
Exemplo n.º 2
0
 public int CreateOrder(Order order)
 {
     int orderId = order.Items.Count;
     return orderId;
 }