title: How to Casting DataSource to List<T>?
body: <p>I have the following method that load products on a DataGridView</p>
  
  <pre><code>private void LoadProducts(List&lt;Product&gt; products)
  {
      Source.DataSource = products;  // Source is BindingSource
      ProductsDataGrid.DataSource = Source;
  }
  </code></pre>
  
  <p>And now I'm trying to give me back to save them as shows below.</p>
  
  <pre><code>private void SaveAll()
  {
     Repository repository = Repository.Instance;
     List&lt;object&gt; products = (List&lt;object&gt;)Source.DataSource; 
     Console.WriteLine("Este es el número {0}", products.Count);
     repository.SaveAll&lt;Product&gt;(products);
     notificacionLbl.Visible = false;
  }
  </code></pre>
  
  <p>But I get an <code>InvalidCastException</code> on this line:</p>
  
  <pre><code>List&lt;object&gt; products = (List&lt;object&gt;)Source.DataSource;
  </code></pre>
  
  <p>So how can I cast the DataSource to an List?</p>