title: Retrieving items from an F# List passed to C#
body: <p>I have a function in C# that is being called in F#, passing its parameters in a <code>Microsoft.FSharp.Collections.List&lt;object&gt;</code>.</p>
  
  <p>How am I able to get the items from the F# List in the C# function?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I have found a 'functional' style way to loop through them, and can pass them to a function as below to return C# System.Collection.List:</p>
  
  <pre><code>private static List&lt;object&gt; GetParams(Microsoft.FSharp.Collections.List&lt;object&gt; inparams)
  {
      List&lt;object&gt; parameters = new List&lt;object&gt;();
      while (inparams != null)
      {
          parameters.Add(inparams.Head);
          inparams = inparams.Tail;
       }
       return inparams;
   }
  </code></pre>
  
  <p><strong>EDIT AGAIN</strong></p>
  
  <p>The F# List, as was pointed out below, is Enumerable, so the above function can be replaced with the line;</p>
  
  <pre><code>new List&lt;LiteralType&gt;(parameters);
  </code></pre>
  
  <p>Is there any way, however, to reference an item in the F# list by index?</p>