Skip to content

Commit a72c85a

Browse files
author
zzzprojects
committed
Update docs
Update docs
1 parent bf73489 commit a72c85a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+465
-196
lines changed

docs/_data/pages.csv

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
title,url,category
2-
Entity Framework Extensions - Overview,overview,tutorials
3-
Entity Framework Extensions - Requirements,requirements,tutorials
4-
Entity Framework Extensions - Installing,installing,tutorials
5-
Entity Framework Extensions - Upgrading,upgrading,tutorials
6-
Entity Framework Extensions - Licensing,licensing,tutorials
7-
Entity Framework Extensions - Introduction,tutorial-introduction,tutorials
8-
Entity Framework Extensions - Bulk SaveChanges,tutorial-bulk-savechanges,tutorials
9-
Entity Framework Extensions - Bulk Operations,tutorial-bulk-operations,tutorials
10-
Entity Framework Extensions - From Query Operations,tutorial-from-query-operations,tutorials
11-
Entity Framework Extensions - API,api,api
12-
Entity Framework Extensions - Bulk SaveChanges,bulk-savechanges,api
13-
Entity Framework Extensions - Bulk Insert,bulk-insert,api
14-
Entity Framework Extensions - Bulk Update,bulk-update,api
15-
Entity Framework Extensions - Bulk Delete,bulk-delete,api
16-
Entity Framework Extensions - Bulk Merge,bulk-merge,api
17-
Entity Framework Extensions - Update from Query,update-from-query,api
18-
Entity Framework Extensions - Delete from Query,delete-from-query,api
19-
Entity Framework Extensions - Audit,audit,api
20-
Entity Framework Extensions - Batch,batch,api
21-
Entity Framework Extensions - Column Expression,column-expression,api
22-
Entity Framework Extensions - Execute Event,execute-event,api
23-
Entity Framework Extensions - Log,log,api
24-
Entity Framework Extensions - Temporary Table,temporary-table,api
25-
Entity Framework Extensions - Transient Error,transient-error,api
26-
Entity Framework Extensions - SQL Server,sql-server,api
27-
Entity Framework Extensions - Articles,articles,articles
28-
Entity Framework Extensions - Benchmark,benchmark,articles
29-
Entity Framework Extensions - Improve BulkSaveChanges,improve-bulk-savechanges,articles
30-
Entity Framework Extensions - Use Custom Column,custom-column,articles
31-
Entity Framework Extensions - Use Custom Key,custom-key,articles
32-
Entity Framework Extensions - Soft Delete,soft-delete,articles
33-
Entity Framework Extensions - Concurrency,concurrency,articles
34-
Entity Framework Extensions - FAQ,faq,faq
35-
Entity Framework Extensions - Contact Us,contact-us,faq
36-
Entity Framework Extensions - Issue Tracker,issue-tracker,faq
37-
Entity Framework Extensions - General,faq-general,faq
38-
Entity Framework Extensions - Installation,faq-installation,faq
39-
Entity Framework Extensions - License,faq-license,faq
40-
Entity Framework Extensions - Troubleshooting,troubleshooting,troubleshooting
2+
Overview,overview,tutorials
3+
Requirements,requirements,tutorials
4+
Installing,installing,tutorials
5+
Upgrading,upgrading,tutorials
6+
Licensing,licensing,tutorials
7+
Introduction,tutorial-introduction,tutorials
8+
Bulk SaveChanges,tutorial-bulk-savechanges,tutorials
9+
Bulk Operations,tutorial-bulk-operations,tutorials
10+
From Query Operations,tutorial-from-query-operations,tutorials
11+
API,api,api
12+
Bulk SaveChanges,bulk-savechanges,api
13+
Bulk Insert,bulk-insert,api
14+
Bulk Update,bulk-update,api
15+
Bulk Delete,bulk-delete,api
16+
Bulk Merge,bulk-merge,api
17+
Update from Query,update-from-query,api
18+
Delete from Query,delete-from-query,api
19+
Audit,audit,api
20+
Batch,batch,api
21+
Column Expression,column-expression,api
22+
Execute Event,execute-event,api
23+
Log,log,api
24+
Temporary Table,temporary-table,api
25+
Transient Error,transient-error,api
26+
SQL Server,sql-server,api
27+
Articles,articles,articles
28+
Benchmark,benchmark,articles
29+
Improve BulkSaveChanges,improve-bulk-savechanges,articles
30+
Use Custom Column,custom-column,articles
31+
Use Custom Key,custom-key,articles
32+
Soft Delete,soft-delete,articles
33+
Concurrency,concurrency,articles
34+
FAQ,faq,faq
35+
Contact Us,contact-us,faq
36+
Issue Tracker,issue-tracker,faq
37+
General,faq-general,faq
38+
Installation,faq-installation,faq
39+
License,faq-license,faq
40+
Troubleshooting,troubleshooting,troubleshooting
4141
Trial Period Expired,trial-period-expired-exception,troubleshooting
4242
MD5,md5-exception,troubleshooting
4343
DbUpdateConcurrency,dbupdateconcurrency-exception,troubleshooting

docs/_includes/aside.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ <h4>Getting Started</h4>
1616

1717
<h4>Tutorials</h4>
1818
<ul>
19-
<li><a href="tutorial-introduction">Introduction</a></li>
2019
<li><a href="tutorial-bulk-savechanges">Bulk SaveChanges</a></li>
2120
<li><a href="tutorial-bulk-operations">Bulk Operations</a></li>
2221
<li><a href="tutorial-batch-operations">Batch Operations</a></li>
@@ -44,8 +43,8 @@ <h4>Bulk Operations</h4>
4443

4544
<h4>Batch Operations</h4>
4645
<ul>
47-
<li><a href="update-from-query">Update from Query</a></li>
4846
<li><a href="delete-from-query">Delete from Query</a></li>
47+
<li><a href="update-from-query">Update from Query</a></li>
4948
</ul>
5049

5150
<h4>Options</h4>

docs/_layouts/default.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<a class="nav-link" href="{{ site.github.url }}/#pricing">Buy</a>
5454
</li>
5555
<li class="nav-item">
56-
<a class="nav-link" href="mailto:[email protected]">Contact</a>
56+
<a class="nav-link" href="{{ site.github.url }}/contact-us">Contact</a>
5757
</li>
5858
<li class="nav-item nav-item-download">
5959
<a class="btn btn-success btn-lg" href="https://www.nuget.org/packages/Z.EntityFramework.Extensions/" role="button" onclick="ga('send', 'event', { eventAction: 'download'});"><i class="fa fa-cloud-download"></i>&nbsp;NuGet Download</a>
@@ -137,7 +137,7 @@
137137
<a class="nav-link" href="http://entityframework-extensions.net/#pricing">Buy</a>
138138
</li>
139139
<li class="nav-item">
140-
<a class="nav-link" href="mailto:[email protected]">Contact</a>
140+
<a class="nav-link" href="{{ site.github.url }}/contact-us">Contact</a>
141141
</li>
142142
<li class="nav-item nav-item-download">
143143
<a class="btn btn-success btn-lg" href="https://www.nuget.org/packages/Z.EntityFramework.Extensions/" role="button" onclick="ga('send', 'event', { eventAction: 'download'});"><i class="fa fa-cloud-download"></i>&nbsp;NuGet Download</a>

docs/_layouts/dev.html

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<a class="nav-link" href="{{ site.github.url }}/#pricing">Buy</a>
5454
</li>
5555
<li class="nav-item">
56-
<a class="nav-link" href="mailto:[email protected]">Contact</a>
56+
<a class="nav-link" href="{{ site.github.url }}/contact-us">Contact</a>
5757
</li>
5858
<li class="nav-item nav-item-download">
5959
<a class="btn btn-success btn-lg" href="https://www.nuget.org/packages/Z.EntityFramework.Extensions/" role="button" onclick="ga('send', 'event', { eventAction: 'download'});"><i class="fa fa-cloud-download"></i>&nbsp;NuGet Download</a>
@@ -137,7 +137,7 @@
137137
<a class="nav-link" href="http://entityframework-extensions.net/#pricing">Buy</a>
138138
</li>
139139
<li class="nav-item">
140-
<a class="nav-link" href="mailto:[email protected]">Contact</a>
140+
<a class="nav-link" href="{{ site.github.url }}/contact-us">Contact</a>
141141
</li>
142142
<li class="nav-item nav-item-download">
143143
<a class="btn btn-success btn-lg" href="https://www.nuget.org/packages/Z.EntityFramework.Extensions/" role="button" onclick="ga('send', 'event', { eventAction: 'download'});"><i class="fa fa-cloud-download"></i>&nbsp;NuGet Download</a>
@@ -385,6 +385,38 @@ <h3>Others</h3>
385385
});
386386
});
387387
</script>
388-
388+
389+
{% if page.path == "pages/tutorials/pricing.md" %}
390+
<script type="text/javascript">
391+
function purchase_validate() {
392+
if($("#agree_agreement").prop('checked')) {
393+
return true;
394+
}
395+
396+
$("#error_validation").modal('show')
397+
return false;
398+
}
399+
400+
function selectProduct() {
401+
if($("#provider_type").val() == "TSCGQDC4YR2MQ") {
402+
$("#seat1").html("Entity Framework Extensions $799 (1 developer seat)");
403+
$("#seat2_4").html("Entity Framework Extensions $999 (2-4 developer seats)");
404+
$("#seat5_9").html("Entity Framework Extensions $1199 (5-9 developer seats)");
405+
$("#seat10_14").html("Entity Framework Extensions $1399 (10-14 developer seats)");
406+
$("#seat15_19").html("Entity Framework Extensions $1599 (15-19 developer seats)");
407+
}
408+
else {
409+
$("#seat1").html("Entity Framework Extensions $599 (1 developer seat)");
410+
$("#seat2_4").html("Entity Framework Extensions $799 (2-4 developer seats)");
411+
$("#seat5_9").html("Entity Framework Extensions $999 (5-9 developer seats)");
412+
$("#seat10_14").html("Entity Framework Extensions $1199 (10-14 developer seats)");
413+
$("#seat15_19").html("Entity Framework Extensions $1399 (15-19 developer seats)");
414+
}
415+
}
416+
417+
selectProduct();
418+
</script>
419+
{% endif %}
420+
389421
</body>
390422
</html>

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ layout: post
137137
<a class="nav-link" href="{{ site.github.url }}/#pricing">Buy</a>
138138
</li>
139139
<li class="nav-item">
140-
<a class="nav-link" href="mailto:[email protected]">Contact</a>
140+
<a class="nav-link" href="{{ site.github.url }}/contact-us">Contact</a>
141141
</li>
142142
<li class="nav-item nav-item-download">
143143
<a class="btn btn-success btn-lg" href="https://www.nuget.org/packages/Z.EntityFramework.Extensions/" role="button" onclick="ga('send', 'event', { eventAction: 'download'});"><i class="fa fa-cloud-download"></i>&nbsp;NuGet Download</a>

docs/pages/api/api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
layout: default
3-
title: Entity Framework Extensions - API
2+
layout: dev
3+
title: API
44
permalink: api
55
---
66

docs/pages/api/bulk-savechanges.md

Lines changed: 56 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,88 @@
11
---
2-
layout: default
3-
title: Entity Framework Extensions - Bulk SaveChanges
2+
layout: dev
3+
title: BulkSaveChanges
44
permalink: bulk-savechanges
55
---
66

77
{% include template-h1.html %}
88

9-
## Introduction
9+
## Definition
1010

11-
BulkSaveChanges work exactly like SaveChanges but way faster!
11+
[BulkSaveChanges](bulk-savechanges) method is the upgraded version of `SaveChanges`.
1212

13-
Using it could not be simpler:
14-
- ADD "Bulk" prefix before "SaveChanges"
13+
All changes made in the context are persisted in the database but way faster by reducing the number of database round-trip required!
1514

16-
### Example
17-
{% include template-example.html %}
18-
{% highlight csharp %}
19-
var ctx = new EntitiesContext();
15+
BulkSaveChanges supports everything:
2016

21-
ctx.Customers.AddRange(listToAdd);
22-
ctx.Customers.RemoveRange(listToRemove);
23-
listToModify.ForEach(x => x.DateModified = DateTime.Now);
17+
- Association (One to One, One to Many, Many to Many, etc.)
18+
- Complex Type
19+
- Enum
20+
- Inheritance (TPC, TPH, TPT)
21+
- Navigation Property
22+
- Self-Hierarchy
23+
- Etc.
24+
25+
{% include template-example.html title='BulkSaveChanges Examples' %}
26+
{% highlight csharp %}
27+
context.Customers.AddRange(listToAdd); // add
28+
context.Customers.RemoveRange(listToRemove); // remove
29+
listToModify.ForEach(x => x.DateModified = DateTime.Now); // modify
2430

2531
// Easy to use
26-
ctx.BulkSaveChanges();
32+
context.BulkSaveChanges();
2733

2834
// Easy to customize
2935
context.BulkSaveChanges(bulk => bulk.BatchSize = 100);
3036
{% endhighlight %}
3137

32-
### Performance Comparisons
38+
## Purpose
39+
Using the `ChangeTracker` to detect and persist change automatically is great! However, it leads very fast to some problem when multiples entities need to be saved.
40+
41+
`SaveChanges` method makes a database round-trip for every change. So if you need to insert 10000 entities, then 10000 database round-trip will be performed which is INSANELY slow.
42+
43+
`BulkSaveChanges` work exactly like `SaveChanges` but reduce the number of database round-trips required to greatly helps to improve the performance.
44+
45+
## Performance Comparisons
3346

3447
| Operations | 1,000 Entities | 2,000 Entities | 5,000 Entities |
3548
| :-------------- | -------------: | -------------: | -------------: |
3649
| SaveChanges | 1,000 ms | 2,000 ms | 5,000 ms |
3750
| BulkSaveChanges | 90 ms | 150 ms | 350 ms |
3851

52+
## FAQ
3953

40-
SaveChanges makes one database round-trip for each entity to insert/update/delete. So if you want to save (add, modify or remove) 10,000 entities, 10,000 databases round trip will be required which are **INSANELY** slow.
54+
### How can I specify more than one option?
55+
You can specify more than one option using anonymous block.
4156

42-
BulkSaveChanges use bulk operations to reduce the number of database round-trip required.
57+
{% include template-example.html %}
58+
{% highlight csharp %}
59+
context.BulkSaveChanges(options => {
60+
options.BatchSize = 100);
61+
options.AllowConcurrency = false;
62+
});
63+
{% endhighlight %}
4364

44-
### Support
65+
### How can I specify the Batch Size?
66+
You can specify a custom batch size using the `BatchSize` option.
4567

46-
BulkSaveChanges support everything!
68+
Read more: [BatchSize](/batch-size)
4769

48-
- Association (One to One, One to Many, Many to Many, etc.)
49-
- Complex Type
50-
- Enum
51-
- Inheritance (TPC, TPH, TPT)
52-
- Navigation Property
53-
- Self-Hierarchy
54-
- Etc.
70+
{% include template-example.html %}
71+
{% highlight csharp %}
72+
context.BulkSaveChanges(options => options.BatchSize = 100);
73+
{% endhighlight %}
74+
75+
### How can I turn off Concurrency Check?
76+
You can turn off concurrency check using the `AllowConcurrency` option.
77+
78+
Read more: [AllowConcurrency](/allow-concurrency)
79+
80+
{% include template-example.html %}
81+
{% highlight csharp %}
82+
context.BulkSaveChanges(options => options.AllowConcurrency = false);
83+
{% endhighlight %}
5584

56-
### Related Articles
85+
## Related Articles
5786

5887
- [How to Benchmark?](benchmark)
5988
- [How to Improve Bulk SaveChanges Performances?](improve-bulk-savechanges)
Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,41 @@
11
---
2-
layout: default
3-
title: Entity Framework Extensions - Delete from Query
2+
layout: dev
3+
title: Delete from Query
44
permalink: delete-from-query
55
---
66

77
{% include template-h1.html %}
88

9-
## Delete FromQuery
10-
Allow you to execute to DELETE multiples records in a database from a LINQ Query without loading entities in the context
9+
## Definition
10+
`DELETE` all rows from the database using a LINQ Query without loading entities in the context.
11+
12+
A `DELETE` statement is built using the LINQ expression and directly executed in the database.
1113

1214
{% include template-example.html %}
1315
{% highlight csharp %}
14-
// DELETE all customers that are inactive for more than two years
15-
context.Customers
16-
.Where(x => x.LastLogin < DateTime.Now.AddYears(-2))
17-
.DeleteFromQuery();
16+
// DELETE all customers that are inactive
17+
context.Customers.Where(x => !x.IsActif).DeleteFromQuery();
18+
19+
// DELETE customers by id
20+
context.Customers.Where(x => x.ID == userId).DeleteFromQuery();
1821
{% endhighlight %}
1922

20-
### Performance Comparisons
23+
## Purpose
24+
`Deleting` entities using `SaveChanges` normally require to load them first in the `ChangeTracker`. These additional round-trips are often not necessary.
25+
26+
`DeleteFromQuery` give you access to directly execute a `DELETE` statement in the database and provide a **HUGE** performance improvement.
27+
28+
## Performance Comparisons
2129

2230
| Operations | 1,000 Entities | 2,000 Entities | 5,000 Entities |
2331
| :-------------- | -------------: | -------------: | -------------: |
2432
| SaveChanges | 1,000 ms | 2,000 ms | 5,000 ms |
2533
| DeleteFromQuery | 1 ms | 1 ms | 1 ms |
2634

27-
SaveChanges makes one database round-trip for each entity to insert/update/delete. So if you want to save (add, modify or remove) 10,000 entities, 10,000 databases round trip will be required which are **INSANELY** slow.
35+
## FAQ
2836

29-
FromQuery operations directly execute the SQL statements on the target database.
37+
### Why DeleteFromQuery is faster than SaveChanges, BulkSaveChanges, and BulkDelete?
3038

31-
### Support
32-
- SQL Server 2008+
33-
- SQL Azure
39+
`DeleteFromQuery` execute a statement directly in SQL such as `DELETE FROM [TableName] WHERE [Key]`.
3440

35-
_More provider will be available on next major version_
41+
Other operations normally require one or multiple database round-trips which make the performance slower.

docs/pages/api/options-audit.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
layout: default
3-
title: Entity Framework Extensions - Audit
2+
layout: dev
3+
title: Audit
44
permalink: audit
55
---
66

docs/pages/api/options-batch.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
layout: default
3-
title: Entity Framework Extensions - Batch
2+
layout: dev
3+
title: Batch
44
permalink: batch
55
---
66

0 commit comments

Comments
 (0)