title: Is it possible to insert large amount of data using linq-to-sql?
body: <p>I need to insert large amount of data into SqlServer 2008. My project is based on linq-to-sql. </p>
  
  <p>I process csv file with 100.000 rows. Each row is mapped to <code>Order</code> object. <code>Order</code> contains also collection of <code>Category</code> and <code>Code</code> objects. I need to map each row to object in order to validate it.</p>
  
  <p>Then I need to insert all these objects into database. </p>
  
  <pre><code>List&lt;Order&gt; orders = Import("test.csv");
  db.Orders.InsertAllOnSubmit(orders);
  db.SubmitChanges();
  
  OR
  
  foreach(Order order in orders)
  db.Orders.InsertOnSubmit(order);
  db.SubmitChanges();
  </code></pre>
  
  <p>Both ways are slow. Is there any workaround? I may use other approach than l2sql for this task. </p>
  
  <p>I read about SqlBulkCopy class - would it handle <strong>inserting child entities</strong> as well?  </p>