title: Is there any other better way to pass parameters to backgroundworker runasync?
body: <p>I am new to <strong>C#</strong> and currently working a project that requires the need for <a href="https://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker(v=vs.110).aspx" rel="nofollow">BackgroundWorkers</a>. I found that the BackgroundWorker <a href="https://msdn.microsoft.com/en-us/library/h01xszh2(v=vs.110).aspx" rel="nofollow">RunWorkerAsync</a> simply takes one object as an argument. But there are situations where I will need to pass more than one object into the <a href="https://msdn.microsoft.com/en-us/library/h01xszh2(v=vs.110).aspx" rel="nofollow">RunWorkerAsync</a> method. </p>
  
  <p>What I currently do is to load all the objects into a List then pass them as a single List object which works quite Ok. But my question is, can this be done better or more nicely ? Are there any problems I could encounter with this approach ?</p>
  
  <pre><code>List&lt;object&gt; data = new List&lt;object&gt;(3);
  
  List.Add(object1);
  List.Add(object2);
  List.Add(object3);
  
  bwImportData.RunWorkerAsync(data);
  
  private void DoWork(object sender, DoWorkEventArgs e)
  {
     List&lt;object&gt; data = e.Arguments a List&lt;object&gt;
     objecttype1 object1 = data[0] as objecttype1;
     objecttype2 object2 = data[0] as objecttype2;
     objecttype3 object2 = data[0] as objecttype3;
  
     //Do stuff
  
  }
  private void RunWorker(object sender, RunWorkerCompletedEventArgs e)
  {
     //Do stuff stuff stuff
  }
  </code></pre>