Guest User

Untitled

a guest
Oct 25th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. using (var ctx = new CustomerContext())
  2. {
  3. foreach(var line in lines)
  4. {
  5. var customer = new Customer();
  6. // ...code...
  7.  
  8. // DetectChanges is invoked every time you call Add
  9. ctx.Customers.Add(customer);
  10. }
  11.  
  12. ctx.SaveChanges();
  13. }
Add Comment
Please, Sign In to add comment