title: Convert Array to custom object list c#
body: <p>I have a array:-</p>
  
  <pre><code>private string[][] barValues = new string[][] { new string[]{ "1.9", "5.8", "4.8", "Since Inception", "24-Jan 2014 to 24 Jun 2014" },
                                                  new string[]{"1.2", "16.5","9.8", "Year to date","01-Apr 2014 to 24-Jun 2014" }, 
                                                  new string[]{"11.6","28.8","23.5","Last quarter","01-Jan to 24-Jun 2014"} };
  </code></pre>
  
  <p>I want to convert this array into my custom list :-</p>
  
  <pre><code>List&lt;Portfolio&gt; list = new List&lt;Portfolio&gt;();
  </code></pre>
  
  <p>I tried doing :-</p>
  
  <pre><code>List&lt;Portfolio&gt; list=myArray.Cast&lt;Portfolio&gt;().ToList();
  </code></pre>
  
  <p>But I get a error:-</p>
  
  <blockquote>
    <p>System.InvalidCastException: Cannot cast from source type to
    destination type.</p>
  </blockquote>
  
  <p>How do I do this conversion?</p>