Skip to content

Commit 1da737e

Browse files
author
zzzprojects
committed
Update website
Update website
1 parent ea4c0d9 commit 1da737e

File tree

13 files changed

+86
-18
lines changed

13 files changed

+86
-18
lines changed

docs/_data/meta.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,4 @@ custom-key,custom-key,custom-key,custom-key,Custom key,,,no,container-doc,sectio
8484
fastest-way-to-insert,fastest-way-to-insert,fastest-way-to-insert,fastest-way-to-insert,Fastest Way to Insert,,,no,container-doc,section-article
8585
improve-bulk-savechanges,improve-bulk-savechanges,improve-bulk-savechanges,improve-bulk-savechanges,Improve BulkSaveChanges,,,no,container-doc,section-article
8686
soft-delete,soft-delete,soft-delete,soft-delete,Soft Delete,,,no,container-doc,section-article
87+
bulk-insert-vs-bulk-savechanges,BulkInsert vs BulkSaveChanges,BulkInsert vs BulkSaveChanges,,BulkInsert vs BulkSaveChanges,,,no,container-doc,section-article
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<br />
2+
<nav class="card card-box card-box-light card-box-nav">
3+
<div class="card-header">
4+
<h3>Quick Links</h3>
5+
</div>
6+
<div class="card-body">
7+
<ul style="padding-left: 0">
8+
<li><a href="{{ site.github.url }}/bulk-insert-vs-bulk-savechanges">BulkInsert vs BulkSaveChanges</a></li>
9+
<li><a href="{{ site.github.url }}/improve-bulk-savechanges">Improve BulkSaveChanges</a></li>
10+
<li><a href="{{ site.github.url }}/include-graph">Include Graph</a></li>
11+
</ul>
12+
</div>
13+
</nav>

docs/_includes/custom/section-sidebar.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ <h3>Options</h3>
6666

6767
<h3>Articles</h3>
6868
<ul>
69+
<li><a href="{{ site.github.url }}/bulk-insert-vs-bulk-savechanges">BulkInsert vs BulkSaveChanges</a></li>
6970
<li><a href="{{ site.github.url }}/benchmark">Make Benchmark</a></li>
7071
<li><a href="{{ site.github.url }}/improve-bulk-savechanges">Improve BulkSaveChanges</a></li>
7172
<li><a href="{{ site.github.url }}/custom-column">Use Custom Column</a></li>

docs/_includes/custom/site-header.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<div class="navbar-collapse collapse justify-content-end" id="nav-site-menu">
1616
<ul class="navbar-nav">
1717
<li class="nav-item">
18-
<a class="nav-link" href="{{ site.github.url }}/tutorials">
18+
<a class="nav-link" href="{{ site.github.url }}/overview">
1919
<i class="fa fa-book" aria-hidden="true"></i>
2020
Tutorials
2121
</a>
@@ -61,7 +61,7 @@
6161
</a>
6262
</li>
6363
<li class="nav-item {{ is_menu_context_api_css_active }}">
64-
<a class="nav-link" href="{{ site.github.url }}/api">
64+
<a class="nav-link" href="{{ site.github.url }}/bulk-savechanges">
6565
API
6666
</a>
6767
</li>

docs/_layouts/default.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ <h1>{{site.data.meta[meta_index].h1}}</h1>
6565
{{ content }}
6666
</div>
6767
<div class="col-lg-2 col-xl-2 section-aside hidden-md-down">
68+
<div class="section-aside-inner">
69+
{% include custom/section-aside.html %}
70+
</div>
6871
</div>
6972
</div>
7073
</div>

docs/_sass/component-card-box.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
//
2222
// card-box-nav
2323
//
24-
.card-box-nav .card-body h5:not(:first-child) {
24+
.card-box-nav .card-body h3:not(:first-child) {
2525
margin-top: 15px;
2626
}
2727
.card-box-nav .card-body ul {

docs/_sass/component-rotator-dark.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
@media (min-width: 992px) {
1212
.rotator .rotator-header {
1313
transform: rotate(4deg);
14+
position: relative;
1415
z-index: 1;
1516
}
1617
.rotator .rotator-header-inner {

docs/_sass/section.scss

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,14 @@
2929

3030

3131
//
32-
// section-aside: TODO
32+
// section-aside
3333
//
34+
.section-aside {
35+
position: relative;
36+
}
37+
.section-aside-inner {
38+
position: fixed;
39+
}
3440

3541
//
3642
//

docs/_sass/site-default.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ input.form-control:focus{
2626
}
2727
}
2828

29+
//
30+
// container
31+
//
32+
.container-page {
33+
padding-bottom: 80px;
34+
}
35+
2936
//
3037
// bootstrap hidden restore
3138
//
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
permalink: bulk-insert-vs-bulk-savechanges
3+
---
4+
5+
## What’s the difference between BulkInsert and BulkSaveChanges?
6+
BulkInsert will always be a lot faster than BulkSaveChanges.
7+
8+
BulkSaveChanges work like SaveChanges but faster. It uses the Change Tracker to get the list of entities and check the Entity State to know which operation should be performed.
9+
10+
In counterpart, Bulk methods such as BulkInsert, BulkUpdate, and BulkDelete doesn’t use at all the Change Tracker to make these methods as efficient as possible. It takes the list of entities from the parameter provided and doesn’t care about the Entity State.
11+
12+
## Should I always use BulkInsert?
13+
No! Even if BulkInsert is faster.
14+
15+
BulkSaveChanges even if slower make everything easier. All you need to do is adding “Bulk” before “SaveChanges” and everything work as expected.
16+
17+
BulkInsert require more time to implement when you have several different lists to insert. You need to create/handle a transaction in your code and specify yourself the right order to save.
18+
19+
## We normally recommend always to use BulkSaveChanges unless you have some critical section you want to boost even more the performance.
20+
How is transaction handled?
21+
22+
BulkSaveChanges as SaveChanges create an internal transaction. So, by default, there is nothing to do.
23+
24+
BulkInsert doesn’t create a transaction by default. If you want to save multiple lists, you will need to handle the transaction in your code.
25+
26+
{% include template-example.html %}
27+
{% highlight csharp %}
28+
var transaction = context.Database.BeginTransaction();
29+
try
30+
{
31+
context.BulkInsert(list1);
32+
context.BulkInsert(list2);
33+
transaction.Commit();
34+
}
35+
catch
36+
{
37+
transaction.Rollback();
38+
}
39+
{% endhighlight %}

0 commit comments

Comments
 (0)