Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. Inserting 2000 entities via DbContext saving changes at the end: 2164ms
  2. Inserting 2000 entities via ObjectContext saving changes at the end: 457ms
  3. Inserting 2000 entities via DbContext saving changes after each object addition: 8420ms
  4. Inserting 2000 entities via ObjectContext saving changes after each object adding: 4857ms
  5. Inserting 2000 entities via DbContext using a new DbContext for each object addition: 4018ms
  6. Deleting 2000 entities via DbContext saving changes at the end: 4794ms
  7. Deleting 2000 entities via ObjectContext saving changes at the end: 261ms
  8. Deleting 2000 entities via DbContext saving changes after each object deletion: 25536ms
  9. Deleting 2000 entities via ObjectContext saving changes after each object deletion: 2110ms
  10.  
  11. dbContext.Configuration.AutoDetectChangesEnabled = false;
  12.  
  13. // Now do all your changes
  14.  
  15. dbContext.ChangeTracker.DetectChanges();
  16. dbContext.SaveChanges();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement