title: LINQ - extract properties values into arrays
body: <p>I have an List of objects and I need to get the values of each property into arrays without iterating the list more than once.<br>
  Here is the current code.<br>
  I can't seem to figure out if I can do this using Linq and only iterate the list once.</p>
  
  <pre><code>var numberOfItems = invoiceItemNotes.Count;
  var postingRcNum = new decimal [numberOfItems];
  var postingLocNum = new decimal[numberOfItems];
  var invoiceNum = new decimal[numberOfItems];
  var orderItemLineNum = new decimal[numberOfItems];
  var seqNum = new decimal[numberOfItems];
  var text = new string[numberOfItems];
  int index = 0;
  foreach (var invoiceItemNote in invoiceItemNotes)
  {
      postingRcNum[index] = invoiceItemNote.POSTING_RC_NUM;
      postingLocNum[index] = invoiceItemNote.POSTING_LOC_NUM;
      invoiceNum[index] = invoiceItemNote.INVOICE_NUM;
      orderItemLineNum[index] = invoiceItemNote.ORDER_ITEM_LINE_NUM;
      seqNum[index] = invoiceItemNote.SEQ_NUM;
      text[index] = invoiceItemNote.TEXT;
      index++;
  }
  using (var cmd = connection.CreateCommand())
  {
      cmd.CommandType = CommandType.StoredProcedure;
      cmd.CommandText = InvoiceInsertCommands.InsertItemNote;
      cmd.BindByName = true;
      cmd.UpdatedRowSource = UpdateRowSource.None;
      cmd.ArrayBindCount = numberOfItems;
      cmd.Parameters.Add(InvoiceItemNoteParameters.PostingRcNum, OracleDbType.Decimal, postingRcNum, ParameterDirection.Input);
      cmd.Parameters.Add(InvoiceItemNoteParameters.PostingLocNum, OracleDbType.Decimal, postingLocNum, ParameterDirection.Input);
      cmd.Parameters.Add(InvoiceItemNoteParameters.InvoiceNum, OracleDbType.Decimal, invoiceNum, ParameterDirection.Input);
      cmd.Parameters.Add(InvoiceItemNoteParameters.OrderItemLineNum, OracleDbType.Decimal, orderItemLineNum, ParameterDirection.Input);
      cmd.Parameters.Add(InvoiceItemNoteParameters.SeqNum, OracleDbType.Decimal, seqNum, ParameterDirection.Input);
      cmd.Parameters.Add(InvoiceItemNoteParameters.Text, OracleDbType.Varchar2, text, ParameterDirection.Input);
  
      cmd.ExecuteNonQuery();
  }
  </code></pre>