title: Add Items to Array In C#
body: <p>I have a shopping cart that I iterate through in a foreach loop. Each Item in the cart needs to be added to an orderItemList array. </p>
  
  <pre><code>orderItemList = 
  [{
  orderItemId = 1,
  quantity = 2
  },{
  orderItemId = 2, 
  quantity =1 
  }]
  </code></pre>
  
  <p>So I was trying to use </p>
  
  <pre><code>foreach(var items in shoppingCart)
  {
  var newOrderItems = new[] 
  {  new orderItem { orderItemId = item.Id , quantity = item.quantity }
  };
  </code></pre>
  
  <p>It is only adding the last item in the cart. It loops through and creates each one but only the last one is added. What am i missing?</p>
  
  <p>newOrderItems only returns the one item even though it loops. </p>