GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||
GeezerVison is showing entityframework-extensions.net — Batch SaveChanges
Entity Framework Batch SaveChangesDescriptionThe Entity Framework The same SQL in the same order as var affectedRows = context.BatchSaveChanges();
Performance ComparisonOn average, people report a performance improvement of 500%.
HINT: What is supported?
Getting StartedReplace SaveChangesOptimizing your performance is very easy, you simply need to replace // var affectedRows = context.SaveChanges(); var affectedRows = context.BatchSaveChanges(); Override SaveChangesOr you can also override the public class EntityContext : DbContext { // ...code... public override int SaveChanges() { return this.BatchSaveChanges(); } } FAQWhy BatchSaveChanges is faster than SaveChanges?The The So, if you need to save 100 entities:
The same SQL in the same order as Is BatchSaveChanges as fast as SaveChanges with one entity?Under the hood, We always recommend to use BatchSaveChanges. What is the difference between BatchSaveChanges and BulkSaveChanges?For a few hundreds of entities or less, the BatchSaveChanges offers better performance than BulkSaveChanges. However, the BulkSaveChanges is a more scalable method. So, it becomes faster than BatchSaveChanges when you start to save thousands of entities. DocumentationBatchSaveChangesMethods
Author: ZZZ Projects | ||||||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |