code_junkie

What is the best way to use the .SaveChanges() method in ADO.Net Data Services?

Nov 11th, 2011
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.16 KB | None | 0 0
  1. int i = 0;
  2. foreach (var item in collection)
  3. {
  4. // do something with your data
  5. if ((i++ % 10) == 0)
  6. context.SaveChanges();
  7. }
  8. context.SaveChanges();
Add Comment
Please, Sign In to add comment