+Oops! The page has moved, or the link is broken.
+
+Let us know how you landed on this page, and we will try to fix the link: info@zzzprojects.com
+
+Go to Home
diff --git a/docs/CNAME b/docs/CNAME
new file mode 100644
index 0000000..fe1243a
--- /dev/null
+++ b/docs/CNAME
@@ -0,0 +1 @@
+linqtosql-plus.net
\ No newline at end of file
diff --git a/docs/_config.yml b/docs/_config.yml
new file mode 100644
index 0000000..8400585
--- /dev/null
+++ b/docs/_config.yml
@@ -0,0 +1,20 @@
+highlighter: rouge
+gems:
+ - jekyll-sitemap
+ga: "UA-55584370-8"
+
+includes:
+- _includes_custom
+
+defaults:
+ -
+ scope:
+ path: ""
+ values:
+ layout: "default"
+ -
+ scope:
+ path: ""
+ type: "pages"
+ values:
+ last_modified_at: "2017-03-13"
diff --git a/docs/_data/meta.csv b/docs/_data/meta.csv
new file mode 100644
index 0000000..21952b9
--- /dev/null
+++ b/docs/_data/meta.csv
@@ -0,0 +1,91 @@
+permalink,title,meta-description,meta-keywords,h1,h2,h3,nagivation,template,css
+index,Learn how to use Entity Framework Bulk Insert with Tutorials & Examples for Code First & Database First.,Learn how to use Entity Framework Bulk Insert with Tutorials & Examples for Code First & Database First.,,,,,,container-none,
+/404.html,Page Moved,Page Moved,,Page Moved,,,,container-none,section-article
+download,Download,Download,,Download,Free monthly trial available,,no,container-page,section-article
+pricing,Purchase,Purchase,,Purchase,"Unlock better performance, be more responsive!",,no,container-page,section-article
+contact-us,Contact Us,Contact Us,,Test our oustanding support,"We usually answer within the next business day, hour, or minutes!",,no,container-page,section-article
+tutorials,Tutorials,Tutorials,,Tutorials,,,,container-page,section-article
+overview,Overview,Overview,,Overview,,,,container-doc,section-article
+requirements,Requirements,Requirements,,Requirements,,,,container-doc,section-article
+installing,Installing,Installing,,Installing,,,,container-doc,section-article
+upgrading,Upgrading,Upgrading,,Upgrading,,,,container-doc,section-article
+licensing,Licensing,Licensing,,Licensing,,,,container-doc,section-article
+tutorial-bulk-savechanges,Bulk SaveChanges,Bulk SaveChanges,,Bulk SaveChanges,,,,container-doc,section-article
+tutorial-bulk-operations,Bulk Operations,Bulk Operations,,Bulk Operations,,,,container-doc,section-article
+tutorial-batch-operations,Batch Operations,Batch Operations,,Batch Operations,,,,container-doc,section-article
+api,API,API,,API,,,,container-doc,section-article
+bulk-savechanges,Bulk SaveChanges,Bulk SaveChanges,,Bulk SaveChanges,,,,container-doc,section-article
+bulk-insert,Bulk Insert,Bulk Insert,,Bulk Insert,,,,container-doc,section-article
+bulk-update,Bulk Update,Bulk Update,,Bulk Update,,,,container-doc,section-article
+bulk-delete,Bulk Delete,Bulk Delete,,Bulk Delete,,,,container-doc,section-article
+bulk-merge,Bulk Merge,Bulk Merge,,Bulk Merge,,,,container-doc,section-article
+bulk-synchronize,Bulk Synchronize,Bulk Synchronize,,Bulk Synchronize,,,,container-doc,section-article
+update-from-query,Update from Query,Update from Query,,Update from Query,,,,container-doc,section-article
+delete-from-query,Delete from Query,Delete from Query,,Delete from Query,,,,container-doc,section-article
+audit,Audit,Audit,,Audit,,,,container-doc,section-article
+batch,Batch,Batch,,Batch,,,,container-doc,section-article
+column,Column,Column,,Column,,,,container-doc,section-article
+context-factory,Context Factory,Context Factory,,Context Factory,,,,container-doc,section-article
+execute-event,Execute Event,Execute Event,,Execute Event,,,,container-doc,section-article
+identity,Identity,Identity,,Identity,,,,container-doc,section-article
+include-graph,Include Graph,Include Graph,,Include Graph,,,,container-doc,section-article
+key,Key,Key,,Key,,,,container-doc,section-article
+logging,Logging,Logging,,Logging,,,,container-doc,section-article
+temporary-table,Temporary Table,Temporary Table,,Temporary Table,,,,container-doc,section-article
+transaction,Transaction,Transaction,,Transaction,,,,container-doc,section-article
+transient-error,Transient Error,Transient Error,,Transient Error,,,,container-doc,section-article
+sql-server,SQL Server,SQL Server,,SQL Server,,,,container-doc,section-article
+faq,FAQ,FAQ,,FAQ,,,,container-doc,section-article
+issue-tracker,Issue Tracker,Issue Tracker,,Issue Tracker,,,,container-doc,section-article
+faq-general,FAQ - General,FAQ - General,,FAQ - General,,,,container-doc,section-article
+faq-installation,FAQ - Installation,FAQ - Installation,,FAQ - Installation,,,,container-doc,section-article
+faq-license,FAQ - License,FAQ - License,,FAQ - License,,,,container-doc,section-article
+problems,Problems,Problems,,Problems,,,,container-doc,section-article
+trial-period-expired-exception,Trial Expired,Trial Expired,,Trial Expired,,,,container-doc,section-article
+md5-exception,MD5 Exception,MD5 Exception,,MD5 Exception,,,,container-doc,section-article
+dbupdateconcurrency-exception,DbUpdateConcurrency,DbUpdateConcurrency,,DbUpdateConcurrency,,,,container-doc,section-article
+dbbulkoperationconcurrency-exception,DbBulkOperationConcurrency,DbBulkOperationConcurrency,,DbBulkOperationConcurrency,,,,container-doc,section-article
+foreign-key-constraint-autodetectchanges-disabled,Foreign Key Constraint,Foreign Key Constraint,,Foreign Key Constraint,,,,container-doc,section-article
+type-not-supported-exception,Type not Supported,Type not Supported,,Type not Supported,,,,container-doc,section-article
+allow-concurrency,allow-concurrency,allow-concurrency,,allow-concurrency,,,no,container-doc,section-article
+allow-duplicate-keys,allow-duplicate-keys,allow-duplicate-keys,,allow-duplicate-keys,,,no,container-doc,section-article
+allow-update-primary-keys,allow-update-primary-keys,allow-update-primary-keys,,allow-update-primary-keys,,,no,container-doc,section-article
+audit-entries,audit-entries,audit-entries,,audit-entries,,,no,container-doc,section-article
+batch-delay-interval,batch-delay-interval,batch-delay-interval,,batch-delay-interval,,,no,container-doc,section-article
+batch-size,batch-size,batch-size,,batch-size,,,no,container-doc,section-article
+batch-timeout,batch-timeout,batch-timeout,,batch-timeout,,,no,container-doc,section-article
+bulk-operation-executed,bulk-operation-executed,bulk-operation-executed,,bulk-operation-executed,,,no,container-doc,section-article
+bulk-operation-executing,bulk-operation-executing,bulk-operation-executing,,bulk-operation-executing,,,no,container-doc,section-article
+column-input-expression,column-input-expression,column-input-expression,,column-input-expression,,,no,container-doc,section-article
+column-output-expression,column-output-expression,column-output-expression,,column-output-expression,,,no,container-doc,section-article
+column-primary-key-expression,column-primary-key-expression,column-primary-key-expression,,column-primary-key-expression,,,no,container-doc,section-article
+ignore-on-merge-insert-expression,ignore-on-merge-insert-expression,ignore-on-merge-insert-expression,,ignore-on-merge-insert-expression,,,no,container-doc,section-article
+ignore-on-merge-update-expression,ignore-on-merge-update-expression,ignore-on-merge-update-expression,,ignore-on-merge-update-expression,,,no,container-doc,section-article
+insert-keep-identity,insert-keep-identity,insert-keep-identity,,insert-keep-identity,,,no,container-doc,section-article
+log,log,log,,log,,,no,container-doc,section-article
+log-dump,log-dump,log-dump,,log-dump,,,no,container-doc,section-article
+merge-keep-identity,merge-keep-identity,merge-keep-identity,,merge-keep-identity,,,no,container-doc,section-article
+retry-count,retry-count,retry-count,,retry-count,,,no,container-doc,section-article
+retry-interval,retry-interval,retry-interval,,retry-interval,,,no,container-doc,section-article
+sql-bulk-copy-options,sql-bulk-copy-options,sql-bulk-copy-options,,sql-bulk-copy-options,,,no,container-doc,section-article
+synchronize-keep-identity,synchronize-keep-identity,synchronize-keep-identity,,synchronize-keep-identity,,,no,container-doc,section-article
+temporary-table-batch-by-table,temporary-table-batch-by-table,temporary-table-batch-by-table,,temporary-table-batch-by-table,,,no,container-doc,section-article
+temporary-table-insert-batch-size,temporary-table-insert-batch-size,temporary-table-insert-batch-size,,temporary-table-insert-batch-size,,,no,container-doc,section-article
+temporary-table-min-record,temporary-table-min-record,temporary-table-min-record,,temporary-table-min-record,,,no,container-doc,section-article
+temporary-table-schema-name,temporary-table-schema-name,temporary-table-schema-name,,temporary-table-schema-name,,,no,container-doc,section-article
+temporary-table-use-table-lock,temporary-table-use-table-lock,temporary-table-use-table-lock,,temporary-table-use-table-lock,,,no,container-doc,section-article
+use-audit,use-audit,use-audit,,use-audit,,,no,container-doc,section-article
+use-log-dump,use-log-dump,use-log-dump,,use-log-dump,,,no,container-doc,section-article
+use-permanent-table,use-permanent-table,use-permanent-table,,use-permanent-table,,,no,container-doc,section-article
+benchmark,benchmark,benchmark,benchmark,Benchmark,,,no,container-doc,section-article
+concurrency,concurrency,concurrency,concurrency,Concurrency,,,no,container-doc,section-article
+custom-column,custom-column,custom-column,custom-column,Custom Column,,,no,container-doc,section-article
+custom-key,custom-key,custom-key,custom-key,Custom key,,,no,container-doc,section-article
+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
+improve-bulk-savechanges,improve-bulk-savechanges,improve-bulk-savechanges,improve-bulk-savechanges,Improve BulkSaveChanges,,,no,container-doc,section-article
+soft-delete,soft-delete,soft-delete,soft-delete,Soft Delete,,,no,container-doc,section-article
+bulk-insert-vs-bulk-savechanges,BulkInsert vs BulkSaveChanges,BulkInsert vs BulkSaveChanges,,BulkInsert vs BulkSaveChanges,,,no,container-doc,section-article
+articles,Articles,Articles,,Articles,,,no,container-doc,section-article
+trial,Trial,Trial,,Trial,,,no,container-doc,section-article
+edmx,Edmx,Edmx,,Edmx,,,no,container-doc,section-article
+out-of-memory,Out of memory,Out of memory,,Out of memory,,,no,container-doc,section-article
diff --git a/docs/_includes/component-rotator-dark-begin.html b/docs/_includes/component-rotator-dark-begin.html
new file mode 100644
index 0000000..f4af7ab
--- /dev/null
+++ b/docs/_includes/component-rotator-dark-begin.html
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/_includes/component-rotator-dark-end.html b/docs/_includes/component-rotator-dark-end.html
new file mode 100644
index 0000000..c571e64
--- /dev/null
+++ b/docs/_includes/component-rotator-dark-end.html
@@ -0,0 +1,6 @@
+
+
+
+
\ No newline at end of file
diff --git a/docs/_includes/component-scroll-to-top.html b/docs/_includes/component-scroll-to-top.html
new file mode 100644
index 0000000..543d90a
--- /dev/null
+++ b/docs/_includes/component-scroll-to-top.html
@@ -0,0 +1,3 @@
+
+
\ No newline at end of file
diff --git a/docs/_includes/infozzzprojects-email.html b/docs/_includes/infozzzprojects-email.html
new file mode 100644
index 0000000..c57c078
--- /dev/null
+++ b/docs/_includes/infozzzprojects-email.html
@@ -0,0 +1 @@
+info@zzzprojects.com
diff --git a/docs/_includes/mail-info.html b/docs/_includes/mail-info.html
new file mode 100644
index 0000000..c57c078
--- /dev/null
+++ b/docs/_includes/mail-info.html
@@ -0,0 +1 @@
+info@zzzprojects.com
diff --git a/docs/_includes/mail-sales.html b/docs/_includes/mail-sales.html
new file mode 100644
index 0000000..2421c08
--- /dev/null
+++ b/docs/_includes/mail-sales.html
@@ -0,0 +1 @@
+sales@zzzprojects.com
diff --git a/docs/_includes/page-home-featured.html b/docs/_includes/page-home-featured.html
new file mode 100644
index 0000000..e69de29
diff --git a/docs/_includes/section-article-end.html b/docs/_includes/section-article-end.html
new file mode 100644
index 0000000..540afba
--- /dev/null
+++ b/docs/_includes/section-article-end.html
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/docs/_includes/section-article-start.html b/docs/_includes/section-article-start.html
new file mode 100644
index 0000000..91f8e48
--- /dev/null
+++ b/docs/_includes/section-article-start.html
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/docs/_includes/section-faq-begin.html b/docs/_includes/section-faq-begin.html
new file mode 100644
index 0000000..91f8e48
--- /dev/null
+++ b/docs/_includes/section-faq-begin.html
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/docs/_includes/section-faq-end.html b/docs/_includes/section-faq-end.html
new file mode 100644
index 0000000..540afba
--- /dev/null
+++ b/docs/_includes/section-faq-end.html
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/docs/_includes/section-header.html b/docs/_includes/section-header.html
new file mode 100644
index 0000000..c03e650
--- /dev/null
+++ b/docs/_includes/section-header.html
@@ -0,0 +1,18 @@
+{% if site.data.meta[meta_index].h1 != null %}
+
+
+{% include component-rotator-dark-begin.html %}
+
+
+
{{site.data.meta[meta_index].h1}}
+ {% if site.data.meta[meta_index].h2 != null %}
+
+
{{ site.data.meta[meta_index].h2 }}
+
+ {% endif %}
+
+
+{% include component-rotator-dark-end.html %}
+
+
+{% endif %}
\ No newline at end of file
diff --git a/docs/_includes/template-example.html b/docs/_includes/template-example.html
new file mode 100644
index 0000000..9b9c19a
--- /dev/null
+++ b/docs/_includes/template-example.html
@@ -0,0 +1,8 @@
+
+{% if include.title == null %}
+ Example
+{% else %}
+ {{ include.title }}
+{% endif %}
+
+{:.code}
diff --git a/docs/_includes/template-exception.html b/docs/_includes/template-exception.html
new file mode 100644
index 0000000..8285735
--- /dev/null
+++ b/docs/_includes/template-exception.html
@@ -0,0 +1,4 @@
+
+ Exception:
+ {{ include.message }}
+
diff --git a/docs/_includes/under-construction.html b/docs/_includes/under-construction.html
new file mode 100644
index 0000000..88dd777
--- /dev/null
+++ b/docs/_includes/under-construction.html
@@ -0,0 +1 @@
+This page is under construction.
\ No newline at end of file
diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html
new file mode 100644
index 0000000..f324919
--- /dev/null
+++ b/docs/_layouts/default.html
@@ -0,0 +1,232 @@
+
+
+
+
+
+
+
+ {% include custom/_global_variable.html %}
+
+
+ {{ site.data.meta[meta_index].title }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {% include custom/site-header.html %}
+
+
+{% if site.data.meta[meta_index].template == "container-none" %}
+
\ No newline at end of file
diff --git a/docs/pages/api/api.md b/docs/pages/api/api.md
new file mode 100644
index 0000000..a9ee45b
--- /dev/null
+++ b/docs/pages/api/api.md
@@ -0,0 +1,69 @@
+---
+permalink: api
+---
+
+
+
+
\ No newline at end of file
diff --git a/docs/pages/api/bulk-delete.md b/docs/pages/api/bulk-delete.md
new file mode 100644
index 0000000..648b49d
--- /dev/null
+++ b/docs/pages/api/bulk-delete.md
@@ -0,0 +1,90 @@
+---
+permalink: bulk-delete
+---
+
+## Definition
+`DELETE` all entities from the database.
+
+All rows that match the entity key are `DELETED` from the database.
+
+{% include template-example.html %}
+{% highlight csharp %}
+// Easy to use
+context.BulkDelete(list);
+
+// Easy to customize
+context.BulkDelete(customers, options => options.ColumnPrimaryKeyExpression = customer => customer.Code);
+{% endhighlight %}
+
+## Purpose
+`Deleting` entities using a custom key from file importation is a typical scenario.
+
+Despite the `ChangeTracker` being outstanding to track what's modified, it lacks in term of scalability and flexibility.
+
+`SaveChanges` requires one database round-trip for every entity to `delete`. So if you need to `delete` 10000 entities, then 10000 database round-trips will be performed which is **INSANELY** slow.
+
+`BulkDelete` in counterpart offers great customization and requires the minimum database round-trips as possible.
+
+## Performance Comparisons
+
+| Operations | 1,000 Entities | 2,000 Entities | 5,000 Entities |
+| :-------------- | -------------: | -------------: | -------------: |
+| SaveChanges | 1,000 ms | 2,000 ms | 5,000 ms |
+| BulkDelete | 45 ms | 50 ms | 60 ms |
+
+{% include section-faq-begin.html %}
+## FAQ
+
+### How can I specify more than one option?
+You can specify more than one option using anonymous block.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkDelete(list, options => {
+ options.BatchSize = 100);
+ options.ColumnInputExpression = c => new {c.ID, c.Name, c.Description});
+});
+{% endhighlight %}
+
+### How can I specify the Batch Size?
+You can specify a custom batch size using the `BatchSize` option.
+
+Read more: [BatchSize](/batch-size)
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkDelete(list, options => options.BatchSize = 100);
+{% endhighlight %}
+
+### How can I specify custom keys to use?
+You can specify custom key using the `ColumnPrimaryKeyExpression` option.
+
+Read more: [ColumnPrimaryKeyExpression](/column-primary-key-expression)
+
+{% include template-example.html %}
+{% highlight csharp %}
+// Single Key
+context.BulkDelete(customers, options => options.ColumnPrimaryKeyExpression = customer => customer.Code);
+
+// Surrogate Key
+context.BulkDelete(customers, options => options.ColumnPrimaryKeyExpression = customer => new { customer.Code1, customer.Code2 });
+{% endhighlight %}
+
+### How can I include child entities (Entity Graph)?
+You cannot. Due to the risk of mistakes, we preferred not to offer this option and make sure every entity you wish to `delete` is specified.
+
+### Why BulkDelete doesn't use the ChangeTracker?
+To provide the best performance possible!
+
+Since using the `ChangeTracker` can greatly reduce performance, we chose to let `BulkSaveChanges` method handle scenarios with `ChangeTracker` and `BulkDelete`, scenarios without it.
+
+### Why BulkDelete is faster than BulkSaveChanges?
+The major difference between both methods is `BulkSaveChanges` uses the `ChangeTracker` but not the `BulkDelete` method.
+
+By skipping the `ChangeTracker`, some methods like `DetectChanges` are no longer required which greatly helps to improve the performance.
+{% include section-faq-end.html %}
+
+## Related Articles
+
+- [How to Benchmark?](benchmark)
+- [How to use Custom Key?](custom-key)
diff --git a/docs/pages/api/bulk-insert.md b/docs/pages/api/bulk-insert.md
new file mode 100644
index 0000000..669f4d8
--- /dev/null
+++ b/docs/pages/api/bulk-insert.md
@@ -0,0 +1,93 @@
+---
+permalink: bulk-insert
+---
+
+## Definition
+`INSERT` all entities in the database.
+
+All entities are considered as new rows and are `INSERTED` in the database.
+
+{% include template-example.html %}
+{% highlight csharp %}
+// Easy to use
+context.BulkInsert(list);
+
+// Easy to customize
+context.BulkInsert(list, options => options.BatchSize = 100);
+{% endhighlight %}
+
+## Purpose
+`Inserting` thousand of entities for an initial load or a file importation is a typical scenario.
+
+`SaveChanges` method makes it quite impossible to handle this kind of situation directly from Entity Framework due to the number of database round-trips required.
+
+`SaveChanges` requires one database round-trip for every entity to `insert`. So if you need to `insert` 10000 entities, then 10000 database round-trips will be performed which is **INSANELY** slow.
+
+`BulkInsert` in counterpart requires the minimum database round-trips as possible. By example under the hood for SQL Server, a simple`SqlBulkCopy` could be performed.
+
+## Performance Comparisons
+
+| Operations | 1,000 Entities | 2,000 Entities | 5,000 Entities |
+| :-------------- | -------------: | -------------: | -------------: |
+| SaveChanges | 1,000 ms | 2,000 ms | 5,000 ms |
+| BulkInsert | 6 ms | 10 ms | 15 ms |
+
+{% include section-faq-begin.html %}
+## FAQ
+
+### How can I specify more than one option?
+You can specify more than one option using anonymous block.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkInsert(list, options => {
+ options.BatchSize = 100);
+ options.ColumnInputExpression = c => new {c.Name, c.Description});
+});
+{% endhighlight %}
+
+### How can I specify the Batch Size?
+You can specify a custom batch size using the `BatchSize` option.
+
+Read more: [BatchSize](/batch-size)
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkInsert(list, options => options.BatchSize = 100);
+{% endhighlight %}
+
+### How can I specify custom columns to Insert?
+You can specify custom columns using the `ColumnInputExpression` option.
+
+Read more: [ColumnInputExpression](/column-input-expression)
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkInsert(list, options => options.ColumnInputExpression = c => new {c.Name, c.Description});
+{% endhighlight %}
+
+### How can I include child entities (Entity Graph)?
+You can include child entities using the `IncludeGraph` option. Make sure to read about the `IncludeGraph` since this option is not as trivial as others.
+
+Read more: [IncludeGraph](/include-graph)
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkInsert(list, options => options.IncludeGraph = true);
+{% endhighlight %}
+
+### Why BulkInsert doesn't use the ChangeTracker?
+To provide the best performance possible!
+
+Since using the `ChangeTracker` can greatly reduce performance, we chose to let `BulkSaveChanges` method handle the scenarios with `ChangeTracker` and `BulkInsert` the scenarios without it.
+
+### Why BulkInsert is faster than BulkSaveChanges?
+The major difference between both methods is `BulkSaveChanges` uses the `ChangeTracker` but not the `BulkInsert` method.
+
+By skipping the `ChangeTracker`, some methods like `Add`, `AddRange`, `DetectChanges` are no longer required which greatly helps to improve the performance.
+{% include section-faq-end.html %}
+
+## Related Articles
+
+- [How to Benchmark?](benchmark)
+- [How to use Custom Column?](custom-column)
diff --git a/docs/pages/api/bulk-merge.md b/docs/pages/api/bulk-merge.md
new file mode 100644
index 0000000..8634a4c
--- /dev/null
+++ b/docs/pages/api/bulk-merge.md
@@ -0,0 +1,118 @@
+---
+permalink: bulk-merge
+---
+
+## Definition
+`MERGE` all entities from the database.
+
+A merge is an `UPSERT` operation. All rows that match the entity key are considered as existing and are `UPDATED`, other rows are considered as new rows and are `INSERTED` in the database.
+
+{% include template-example.html %}
+{% highlight csharp %}
+// Easy to use
+ctx.BulkMerge(list);
+
+// Easy to customize
+context.BulkMerge(customers, options => options.ColumnPrimaryKeyExpression = customer => customer.Code);
+{% endhighlight %}
+
+## Purpose
+`Merging` entities using a custom key from file importation is a typical scenario.
+
+Despite the `ChangeTracker` being outstanding to track what's modified, it lacks in term of scalability and flexibility.
+
+`SaveChanges` requires one database round-trip for every entity to `insert` or `update`. So if you need to `insert` or `update` 10000 entities, then 10000 database round-trips will be performed which is **INSANELY** slow.
+
+`BulkMerge` in counterpart offers great customization and requires the minimum database round-trips as possible.
+
+## Performance Comparisons
+
+| Operations | 1,000 Entities | 2,000 Entities | 5,000 Entities |
+| :-------------- | -------------: | -------------: | -------------: |
+| SaveChanges | 1,000 ms | 2,000 ms | 5,000 ms |
+| BulkMerge | 65 ms | 80 ms | 110 ms |
+
+{% include section-faq-begin.html %}
+## FAQ
+
+### How can I specify more than one option?
+You can specify more than one option using anonymous block.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkMerge(list, options => {
+ options.BatchSize = 100);
+ options.ColumnInputExpression = c => new {c.ID, c.Name, c.Description});
+});
+{% endhighlight %}
+
+### How can I specify the Batch Size?
+You can specify a custom batch size using the `BatchSize` option.
+
+Read more: [BatchSize](/batch-size)
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkMerge(list, options => options.BatchSize = 100);
+{% endhighlight %}
+
+### How can I specify custom columns to Merge?
+You can specify custom columns using the `ColumnInputExpression` option.
+
+Read more: [ColumnInputExpression](/column-input-expression)
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkMerge(list, options => options.ColumnInputExpression = c => new {c.Name, c.Description});
+{% endhighlight %}
+
+### How can I specify custom columns to exclude on insert or update?
+You can specify custom columns to exclude using the `IgnoreOnMergeInsertExpression` and `IgnoreOnMergeUpdateExpression` option.
+
+Read more: [IgnoreOnMergeInsertExpression](/ignore-on-merge-insert-expression)
+
+Read more: [IgnoreOnMergeUpdateExpression](/ignore-on-merge-update-expression)
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkMerge(list, options =>
+ {
+ options.IgnoreOnMergeInsertExpression = customer => new { customer.UpdatedDate, customer.UpdatedUser };
+ options.IgnoreOnMergeUpdateExpression = customer => customer.Code, customer.Col2;
+ });
+{% endhighlight %}
+
+### How can I specify custom keys to use?
+You can specify custom keys using the `ColumnPrimaryKeyExpression` option.
+
+Read more: [ColumnPrimaryKeyExpression](/column-primary-key-expression)
+
+{% include template-example.html %}
+{% highlight csharp %}
+// Single Key
+context.BulkMerge(customers, options => options.ColumnPrimaryKeyExpression = customer => customer.Code);
+
+// Surrogate Key
+context.BulkMerge(customers, options => options.ColumnPrimaryKeyExpression = customer => new { customer.Code1, customer.Code2 });
+{% endhighlight %}
+
+### How can I include child entities (Entity Graph)?
+You can include child entities using the `IncludeGraph` option. Make sure to read about the `IncludeGraph` since this option is not as trivial as others.
+
+Read more: [IncludeGraph](/include-graph)
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkMerge(list, options => options.IncludeGraph = true);
+{% endhighlight %}
+
+### Why BulkMerge doesn't use the ChangeTracker?
+To provide the best performance possible!
+
+Since using the `ChangeTracker` can greatly reduce performance, we chose to let `BulkSaveChanges` method handle scenarios with `ChangeTracker` and `BulkMerge`, scenarios without it.
+{% include section-faq-end.html %}
+
+## Related Articles
+- [How to Benchmark?](benchmark)
+- [How to use Custom Column?](custom-column)
+- [How to use Custom Key?](custom-key)
diff --git a/docs/pages/api/bulk-savechanges.md b/docs/pages/api/bulk-savechanges.md
new file mode 100644
index 0000000..3d1ad7b
--- /dev/null
+++ b/docs/pages/api/bulk-savechanges.md
@@ -0,0 +1,86 @@
+---
+permalink: bulk-savechanges
+---
+
+## Definition
+
+BulkSaveChanges method is the upgraded version of `SaveChanges`.
+
+All changes made in the context are persisted in the database but way faster by reducing the number of database round-trip required!
+
+BulkSaveChanges supports everything:
+
+- Association (One to One, One to Many, Many to Many, etc.)
+- Complex Type
+- Enum
+- Inheritance (TPC, TPH, TPT)
+- Navigation Property
+- Self-Hierarchy
+- Etc.
+
+{% include template-example.html title='BulkSaveChanges Examples' %}
+{% highlight csharp %}
+context.Customers.AddRange(listToAdd); // add
+context.Customers.RemoveRange(listToRemove); // remove
+listToModify.ForEach(x => x.DateModified = DateTime.Now); // modify
+
+// Easy to use
+context.BulkSaveChanges();
+
+// Easy to customize
+context.BulkSaveChanges(bulk => bulk.BatchSize = 100);
+{% endhighlight %}
+
+## Purpose
+Using the `ChangeTracker` to detect and persist changes automatically is great! However, it leads very fast to some problems when multiple entities need to be saved.
+
+`SaveChanges` method makes a database round-trip for every change. So if you need to insert 10000 entities, then 10000 database round-trips will be performed which is INSANELY slow.
+
+`BulkSaveChanges` works exactly like `SaveChanges` but reduces the number of database round-trips required to greatly help improve the performance.
+
+## Performance Comparisons
+
+| Operations | 1,000 Entities | 2,000 Entities | 5,000 Entities |
+| :-------------- | -------------: | -------------: | -------------: |
+| SaveChanges | 1,000 ms | 2,000 ms | 5,000 ms |
+| BulkSaveChanges | 90 ms | 150 ms | 350 ms |
+
+{% include section-faq-begin.html %}
+## FAQ
+
+### How can I specify more than one option?
+You can specify more than one option using anonymous block.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSaveChanges(options => {
+ options.BatchSize = 100);
+ options.AllowConcurrency = false;
+});
+{% endhighlight %}
+
+### How can I specify the Batch Size?
+You can specify a custom batch size using the `BatchSize` option.
+
+Read more: [BatchSize](/batch-size)
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSaveChanges(options => options.BatchSize = 100);
+{% endhighlight %}
+
+### How can I turn off Concurrency Check?
+You can turn off concurrency check using the `AllowConcurrency` option.
+
+Read more: [AllowConcurrency](/allow-concurrency)
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSaveChanges(options => options.AllowConcurrency = false);
+{% endhighlight %}
+{% include section-faq-end.html %}
+
+## Related Articles
+
+- [How to Benchmark?](benchmark)
+- [How to Improve Bulk SaveChanges Performances?](improve-bulk-savechanges)
diff --git a/docs/pages/api/bulk-synchronize.md b/docs/pages/api/bulk-synchronize.md
new file mode 100644
index 0000000..55f0848
--- /dev/null
+++ b/docs/pages/api/bulk-synchronize.md
@@ -0,0 +1,85 @@
+---
+permalink: bulk-synchronize
+---
+
+## Definition
+`SYNCHRONIZE` all entities from the database.
+
+A synchronize is a mirror operation from the data source to the database. All rows that match the entity key are `UPDATED`, non-matching rows that exist from the source are `INSERTED`, non-matching rows that exist in the database are `DELETED`.
+
+The database table becomes a mirror of the entity list provided.
+
+{% include template-example.html %}
+{% highlight csharp %}
+// Easy to use
+ctx.BulkSynchronize(list);
+
+// Easy to customize
+context.BulkSynchronize(customers, options => options.ColumnPrimaryKeyExpression = customer => customer.Code);
+{% endhighlight %}
+
+## Purpose
+`Synchronizing` entities with the database is a very rare scenario, but it may happen when two databases need to be synchronized.
+
+`BulkSynchronize` give you the scalability and flexibility required when if you encounter this situation.
+
+## Performance Comparisons
+
+| Operations | 1,000 Entities | 2,000 Entities | 5,000 Entities |
+| :-------------- | -------------: | -------------: | -------------: |
+| SaveChanges | 1,000 ms | 2,000 ms | 5,000 ms |
+| BulkSynchronize | 55 ms | 65 ms | 85 ms |
+
+{% include section-faq-begin.html %}
+## FAQ
+
+### How can I specify more than one option?
+You can specify more than one option using anonymous block.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSynchronize(list, options => {
+ options.BatchSize = 100);
+ options.ColumnInputExpression = c => new {c.ID, c.Name, c.Description});
+});
+{% endhighlight %}
+
+### How can I specify the Batch Size?
+You can specify a custom batch size using the `BatchSize` option.
+
+Read more: [BatchSize](/batch-size)
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSynchronize(list, options => options.BatchSize = 100);
+{% endhighlight %}
+
+### How can I specify custom columns to Synchronize?
+You can specify custom columns using the `ColumnInputExpression` option.
+
+Read more: [ColumnInputExpression](/column-input-expression)
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSynchronize(list, options => options.ColumnInputExpression = c => new {c.Name, c.Description});
+{% endhighlight %}
+
+### How can I specify custom keys to use?
+You can specify custom keys using the `ColumnPrimaryKeyExpression` option.
+
+Read more: [ColumnPrimaryKeyExpression](/column-primary-key-expression)
+
+{% include template-example.html %}
+{% highlight csharp %}
+// Single Key
+context.BulkSynchronize(customers, options => options.ColumnPrimaryKeyExpression = customer => customer.Code);
+
+// Surrogate Key
+context.BulkSynchronize(customers, options => options.ColumnPrimaryKeyExpression = customer => new { customer.Code1, customer.Code2 });
+{% endhighlight %}
+{% include section-faq-end.html %}
+
+## Related Articles
+- [How to Benchmark?](benchmark)
+- [How to use Custom Column?](custom-column)
+- [How to use Custom Key?](custom-key)
\ No newline at end of file
diff --git a/docs/pages/api/bulk-update.md b/docs/pages/api/bulk-update.md
new file mode 100644
index 0000000..3307ca6
--- /dev/null
+++ b/docs/pages/api/bulk-update.md
@@ -0,0 +1,108 @@
+---
+permalink: bulk-update
+---
+
+## Definition
+`UPDATE` all entities in the database.
+
+All rows that match the entity key are considered as existing and are `UPDATED` in the database.
+
+{% include template-example.html %}
+{% highlight csharp %}
+// Easy to use
+context.BulkUpdate(list);
+
+// Easy to customize
+context.BulkUpdate(customers, options => options.ColumnPrimaryKeyExpression = customer => customer.Code);
+{% endhighlight %}
+
+## Purpose
+`Updating` entities using a custom key from file importation is a typical scenario.
+
+Despite the `ChangeTracker` being outstanding to track what's modified, it lacks in term of scalability and flexibility.
+
+`SaveChanges` requires one database round-trip for every entity to `update`. So if you need to `update` 10000 entities, then 10000 database round-trips will be performed which is **INSANELY** slow.
+
+`BulkUpdate` in counterpart offers great customization and requires the minimum database round-trips possible.
+
+## Performance Comparisons
+
+| Operations | 1,000 Entities | 2,000 Entities | 5,000 Entities |
+| :-------------- | -------------: | -------------: | -------------: |
+| SaveChanges | 1,000 ms | 2,000 ms | 5,000 ms |
+| BulkUpdate | 50 ms | 55 ms | 65 ms |
+
+{% include section-faq-begin.html %}
+## FAQ
+
+### How can I specify more than one option?
+You can specify more than one option using anonymous block.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkUpdate(list, options => {
+ options.BatchSize = 100);
+ options.ColumnInputExpression = c => new {c.ID, c.Name, c.Description});
+});
+{% endhighlight %}
+
+### How can I specify the Batch Size?
+You can specify a custom batch size using the `BatchSize` option.
+
+Read more: [BatchSize](/batch-size)
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkUpdate(list, options => options.BatchSize = 100);
+{% endhighlight %}
+
+### How can I specify custom columns to Update?
+You can specify custom columns using the `ColumnInputExpression` option.
+
+Read more: [ColumnInputExpression](/column-input-expression)
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkUpdate(list, options => options.ColumnInputExpression = c => new {c.Name, c.Description});
+{% endhighlight %}
+
+### How can I specify custom keys to use?
+You can specify custom key using the `ColumnPrimaryKeyExpression` option.
+
+Read more: [ColumnPrimaryKeyExpression](/column-primary-key-expression)
+
+{% include template-example.html %}
+{% highlight csharp %}
+// Single Key
+context.BulkUpdate(customers, options => options.ColumnPrimaryKeyExpression = customer => customer.Code);
+
+// Surrogate Key
+context.BulkUpdate(customers, options => options.ColumnPrimaryKeyExpression = customer => new { customer.Code1, customer.Code2 });
+{% endhighlight %}
+
+### How can I include child entities (Entity Graph)?
+You can include child entities using the `IncludeGraph` option. Make sure to read about the `IncludeGraph` since this option is not as trivial as others.
+
+Read more: [IncludeGraph](/include-graph)
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkUpdate(list, options => options.IncludeGraph = true);
+{% endhighlight %}
+
+### Why BulkUpdate doesn't use the ChangeTracker?
+To provide the best performance possible!
+
+Since using the `ChangeTracker` can greatly reduce performance, we chose to let `BulkSaveChanges` method handle scenarios with `ChangeTracker` and `BulkUpdate`, scenarios without it.
+
+### Why BulkUpdate is faster than BulkSaveChanges?
+The major difference between both methods is `BulkSaveChanges` uses the `ChangeTracker` but not the `BulkUpdate` method.
+
+By skipping the `ChangeTracker`, some methods like `DetectChanges` are no longer required which greatly helps to improve the performance.
+{% include section-faq-end.html %}
+
+## Related Articles
+
+- [How to Benchmark?](benchmark)
+- [How to use Custom Column?](custom-column)
+- [How to use Custom Key?](custom-key)
diff --git a/docs/pages/api/delete-from-query.md b/docs/pages/api/delete-from-query.md
new file mode 100644
index 0000000..f8bec60
--- /dev/null
+++ b/docs/pages/api/delete-from-query.md
@@ -0,0 +1,39 @@
+---
+permalink: delete-from-query
+---
+
+## Definition
+`DELETE` all rows from the database using a LINQ Query without loading entities in the context.
+
+A `DELETE` statement is built using the LINQ expression and directly executed in the database.
+
+{% include template-example.html %}
+{% highlight csharp %}
+// DELETE all customers that are inactive
+context.Customers.Where(x => !x.IsActif).DeleteFromQuery();
+
+// DELETE customers by id
+context.Customers.Where(x => x.ID == userId).DeleteFromQuery();
+{% endhighlight %}
+
+## Purpose
+`Deleting` entities using `SaveChanges` normally requires to load them first in the `ChangeTracker`. These additional round-trips are often not necessary.
+
+`DeleteFromQuery` gives you access to directly execute a `DELETE` statement in the database and provide a **HUGE** performance improvement.
+
+## Performance Comparisons
+
+| Operations | 1,000 Entities | 2,000 Entities | 5,000 Entities |
+| :-------------- | -------------: | -------------: | -------------: |
+| SaveChanges | 1,000 ms | 2,000 ms | 5,000 ms |
+| DeleteFromQuery | 1 ms | 1 ms | 1 ms |
+
+{% include section-faq-begin.html %}
+## FAQ
+
+### Why DeleteFromQuery is faster than SaveChanges, BulkSaveChanges, and BulkDelete?
+
+`DeleteFromQuery` executes a statement directly in SQL such as `DELETE FROM [TableName] WHERE [Key]`.
+
+Other operations normally require one or multiple database round-trips which makes the performance slower.
+{% include section-faq-end.html %}
\ No newline at end of file
diff --git a/docs/pages/api/options-summary/include-graph.md b/docs/pages/api/options-summary/include-graph.md
new file mode 100644
index 0000000..b7c03d2
--- /dev/null
+++ b/docs/pages/api/options-summary/include-graph.md
@@ -0,0 +1,76 @@
+---
+permalink: include-graph
+---
+
+The IncludeGraph options allow to INSERT/UPDATE/MERGE entities by including the child entities graph.
+By example, if you use BulkInsert using a list of Invoice with the options IncludeGraph, all invoices items will also be inserted.
+
+{% include template-example.html %}
+{% highlight csharp %}
+ctx.BulkInsert(invoices, options => options.IncludeGraph = true);
+{% endhighlight %}
+
+## IncludeGraphOperationBuilder
+The IncludeGraphOperationBuilder let you customize the bulk operations by entity type.
+
+Options are not copied when using IncludeGraph
+
+{% include template-example.html %}
+{% highlight csharp %}
+ctx.BulkMerge(users, options =>
+{
+ options.IncludeGraph = true;
+ options.IncludeGraphOperationBuilder = operation =>
+ {
+ if (operation is BulkOperation)
+ {
+ var bulk = (BulkOperation) operation;
+ bulk.ColumnPrimaryKeyExpression = x => x.Name;
+ }
+ else if (operation is BulkOperation)
+ {
+ var bulk = (BulkOperation) operation;
+ bulk.ColumnPrimaryKeyExpression = x => x.Name;
+ }
+ };
+});
+{% endhighlight %}
+
+### ReadOnly
+You can specify that some entities should not be inserted/updated by marked them as ReadOnly.
+
+{% include template-example.html %}
+{% highlight csharp %}
+ctx.BulkMerge(users, options =>
+{
+ options.IncludeGraph = true;
+ options.IncludeGraphOperationBuilder = operation =>
+ {
+ if (operation is BulkOperation)
+ {
+ var bulk = (BulkOperation) operation;
+ bulk.IsReadOnly = true;
+ }
+ };
+});
+{% endhighlight %}
+
+
+{% include section-faq-begin.html %}
+## FAQ
+
+### Why I receive an error that asks me to specify a context factory?
+To retrieve the current entities graph, our library requires a working context to use some Entity Framework feature without impacting the current context.
+The context factory is optional if your context has a default constructor.
+
+Read more: [Context Factory](context-factory)
+
+### Why I received an error that asks me to use unsafe mode?
+The unsafe mode is required when some proxy entities are found in the graph.
+To retrieve all information, we need to detach temporary proxy type from the current context before re-attaching them.
+There is currently no known issue about this technic, but we prefer to force people to understand that some unsafe code is currently done under the hood by our library.
+
+### Why is IncludeGraph not compatible with BulkDelete?
+For security purpose, we prefer to force people to delete their entities. We currently have no plan to support it.
+
+{% include section-faq-end.html %}
\ No newline at end of file
diff --git a/docs/pages/api/options-summary/options-audit.md b/docs/pages/api/options-summary/options-audit.md
new file mode 100644
index 0000000..ca569cb
--- /dev/null
+++ b/docs/pages/api/options-summary/options-audit.md
@@ -0,0 +1,43 @@
+---
+permalink: audit
+---
+
+## UseAudit
+Gets or sets if `INSERTED` and `DELETED` data from the database should be returned as `AuditEntries`.
+
+{% include template-example.html %}
+{% highlight csharp %}
+List auditEntries = new List();
+
+context.BulkSaveChanges(options =>
+{
+ options.UseAudit = true;
+ options.BulkOperationExecuted = bulkOperation => auditEntries.AddRange(bulkOperation.AuditEntries);
+});
+
+{% endhighlight %}
+
+---
+
+## AuditEntries
+Gets `INSERTED` and `DELETED` data when `UseAudit` option is enabled.
+
+{% include template-example.html %}
+{% highlight csharp %}
+List auditEntries = new List();
+
+context.BulkSaveChanges(options =>
+{
+ options.UseAudit = true;
+ options.BulkOperationExecuted = bulkOperation => auditEntries.AddRange(bulkOperation.AuditEntries);
+});
+
+foreach (var entry in auditEntries)
+{
+ foreach (var value in entry.Values)
+ {
+ var oldValue = value.OldValue;
+ var newValue = value.NewValue;
+ }
+}
+{% endhighlight %}
\ No newline at end of file
diff --git a/docs/pages/api/options-summary/options-batch.md b/docs/pages/api/options-summary/options-batch.md
new file mode 100644
index 0000000..7b32c32
--- /dev/null
+++ b/docs/pages/api/options-summary/options-batch.md
@@ -0,0 +1,31 @@
+---
+permalink: batch
+---
+
+### BatchSize
+Gets or sets the number of records to use in a batch.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSaveChanges(options => options.BatchSize = 1000);
+{% endhighlight %}
+
+---
+
+### BatchTimeout
+Gets or sets the maximum of time in seconds to wait for a batch before the command throws a timeout exception.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSaveChanges(options => options.BatchTimeout = 180);
+{% endhighlight %}
+
+---
+
+### BatchDelayInterval
+Gets or sets a delay in milliseconds to wait between batch.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkInsert(list, options => options.BatchDelayInterval = 100);
+{% endhighlight %}
\ No newline at end of file
diff --git a/docs/pages/api/options-summary/options-column.md b/docs/pages/api/options-summary/options-column.md
new file mode 100644
index 0000000..233386b
--- /dev/null
+++ b/docs/pages/api/options-summary/options-column.md
@@ -0,0 +1,67 @@
+---
+permalink: column
+---
+
+## Column Input
+Gets or sets columns to map with the direction `Input`.
+
+The key is required for operation such as `BulkUpdate` and `BulkMerge`.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkMerge(list, options =>
+ options.ColumnInputExpression = entity => new {entity.ID, entity.Code}
+);
+{% endhighlight %}
+
+## Column Output
+Gets or sets columns to map with the direction `Output`.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkMerge(list, options =>
+ options.ColumnOutputExpression = entity => new {entity.ModifiedDate, entity.ModifiedUser}
+);
+{% endhighlight %}
+
+## Column InputOutput
+Gets or sets columns to map with the direction `InputOutput`.
+
+The key is required for operation such as `BulkUpdate` and `BulkMerge`.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkMerge(list, options =>
+ options.ColumnInputOutputExpression = entity => new {entity.ID, entity.Code}
+);
+{% endhighlight %}
+
+## Column Primary Key
+Gets or sets columns to use as the `key` for the operation.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkMerge(list, options =>
+ options.ColumnPrimaryKeyExpression = entity => new { entity.Code1, entity.Code2 }
+);
+{% endhighlight %}
+
+## Ignore On Merge Insert
+Gets or sets columns to ignore when the `BulkMerge` method executes the `insert` statement.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkMerge(list, options =>
+ options.IgnoreOnMergeUpdateExpression = entity => new {entity.ModifiedDate, entity.ModifiedUser}
+);
+{% endhighlight %}
+
+## Ignore On Merge Update
+Gets or sets columns to ignore when the `BulkMerge` method executes the `update` statement.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkMerge(list, options =>
+ options.IgnoreOnMergeUpdateExpression = entity => new {entity.CreatedDate, entity.CreatedUser}
+);
+{% endhighlight %}
\ No newline at end of file
diff --git a/docs/pages/api/options-summary/options-context-factory.md b/docs/pages/api/options-summary/options-context-factory.md
new file mode 100644
index 0000000..3ab5807
--- /dev/null
+++ b/docs/pages/api/options-summary/options-context-factory.md
@@ -0,0 +1,65 @@
+---
+permalink: context-factory
+---
+
+The context factory is required to provide a working context to the EFE library. This context will be used by example to retrieve some information by attaching/detaching entities without impacting the current context.
+If your context has a default constructor (no parameter), specifying a context factory may be optional unless your context requires some special configuration.
+
+### EF6/EF5/EF4
+Having a default context constructor or specifying a context factory is only required with the following options:
+- IncludeGraph
+
+### EF Core
+Having a default context constructor or specifying a context factory is always required.
+
+## Context Factory
+The context factory is a function `Func` that provide the current DbContext as a parameter and require to return a new DbContext.
+The current DbContext is passed in a parameter in case you need to create a working context that depends on the current context configuration or type.
+
+{% include template-example.html %}
+{% highlight csharp %}
+// Using the default constructor
+EntityFrameworkManager.ContextFactory = context => new CurrentContext();
+
+// Using a constructor that requires a connection string
+EntityFrameworkManager.ContextFactory = context => new CurrentContext(My.ConnectionString);
+
+// Using a constructor that requires optionsBuilder (EF Core)
+EntityFrameworkManager.ContextFactory = context =>
+{
+ var optionsBuilder = new DbContextOptionsBuilder();
+ optionsBuilder.UseSqlServer(My.ConnectionString);
+ return new EntityContext(optionsBuilder.Options);
+};
+
+// Using a constructor that depends on the current context
+EntityFrameworkManager.ContextFactory = context =>
+{
+ if (context is EntityContext)
+ {
+ return new EntityContext();
+ }
+ else
+ {
+ return new ElseContext();
+ }
+};
+{% endhighlight %}
+
+## Default Constructor
+If your context has a default constructor, you might now need to specify a context factory.
+
+{% include template-example.html %}
+{% highlight csharp %}
+public class EntitiesContext : DbContext
+{
+ public EntitiesContext() : base("CodeFirstEntities")
+ {
+ // I'm a default constructor!
+ }
+
+ // ...code...
+}
+{% endhighlight %}
+
+
diff --git a/docs/pages/api/options-summary/options-execute-event.md b/docs/pages/api/options-summary/options-execute-event.md
new file mode 100644
index 0000000..37d22a6
--- /dev/null
+++ b/docs/pages/api/options-summary/options-execute-event.md
@@ -0,0 +1,25 @@
+---
+permalink: execute-event
+---
+
+## BulkOperationExecuting
+Gets or sets an action to execute `before` the bulk operation is executed.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSaveChanges(options => {
+ options.BulkOperationExecuting = bulkOperation => { /* configuration */ };
+});
+{% endhighlight %}
+
+---
+
+## BulkOperationExecuted
+Gets or sets an action to execute `after` the bulk operation is executed.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSaveChanges(options => {
+ options.BulkOperationExecuted = bulkOperation => { /* configuration */ };
+});
+{% endhighlight %}
diff --git a/docs/pages/api/options-summary/options-identity.md b/docs/pages/api/options-summary/options-identity.md
new file mode 100644
index 0000000..9458564
--- /dev/null
+++ b/docs/pages/api/options-summary/options-identity.md
@@ -0,0 +1,31 @@
+---
+permalink: identity
+---
+
+### InsertKeepIdentity
+Gets or sets if the source identity value should be preserved on `Insert`. When not specified, identity values are assigned by the destination.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.Insert(options => options.InsertKeepIdentity = true);
+{% endhighlight %}
+
+---
+
+### MergeKeepIdentity
+Gets or sets if the source identity value should be preserved on `Merge`. When not specified, identity values are assigned by the destination.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkMerge(options => options.MergeKeepIdentity = true);
+{% endhighlight %}
+
+---
+
+### SynchronizeKeepIdentity
+Gets or sets if the source identity value should be preserved on `Synchronize`. When not specified, identity values are assigned by the destination.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSynchronize(options => options.SynchronizeKeepIdentity = true);
+{% endhighlight %}
\ No newline at end of file
diff --git a/docs/pages/api/options-summary/options-key.md b/docs/pages/api/options-summary/options-key.md
new file mode 100644
index 0000000..4371526
--- /dev/null
+++ b/docs/pages/api/options-summary/options-key.md
@@ -0,0 +1,21 @@
+---
+permalink: key
+---
+
+## AllowDuplicateKeys
+Gets or sets if a duplicate key is possible in the source.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSaveChanges(options => options.AllowDuplicateKeys = true);
+{% endhighlight %}
+
+---
+
+## AllowUpdatePrimaryKeys
+Gets or sets if the key must also be included in columns to `UPDATE`.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSaveChanges(options => options.AllowUpdatePrimaryKeys = true);
+{% endhighlight %}
diff --git a/docs/pages/api/options-summary/options-logging.md b/docs/pages/api/options-summary/options-logging.md
new file mode 100644
index 0000000..d749065
--- /dev/null
+++ b/docs/pages/api/options-summary/options-logging.md
@@ -0,0 +1,48 @@
+---
+permalink: logging
+---
+
+## Log
+Gets or sets an action to `log` all database events as soon as they happen.
+
+{% include template-example.html %}
+{% highlight csharp %}
+StringBuilder logger = new StringBuilder();
+
+context.BulkSaveChanges(options =>
+{
+ options.Log += s => logger.AppendLine(s);
+});
+{% endhighlight %}
+
+---
+
+## UseLogDump
+Gets or sets if all `log` related to database event should be stored in a `LogDump` properties.
+
+{% include template-example.html %}
+{% highlight csharp %}
+StringBuilder logDump;
+
+context.BulkSaveChanges(options =>
+{
+ options.UseLogDump = true;
+ options.BulkOperationExecuted = bulkOperation => logDump = bulkOperation.LogDump;
+});
+{% endhighlight %}
+
+---
+
+## LogDump
+Gets all `logged` database event when `UseLogDump` is enabled.
+
+{% include template-example.html %}
+{% highlight csharp %}
+StringBuilder logDump;
+
+context.BulkSaveChanges(options =>
+{
+ options.UseLogDump = true;
+ options.BulkOperationExecuted = bulkOperation => logDump = bulkOperation.LogDump;
+});
+{% endhighlight %}
diff --git a/docs/pages/api/options-summary/options-sql-server.md b/docs/pages/api/options-summary/options-sql-server.md
new file mode 100644
index 0000000..784c2ff
--- /dev/null
+++ b/docs/pages/api/options-summary/options-sql-server.md
@@ -0,0 +1,14 @@
+---
+permalink: sql-server
+---
+
+## SqlBulkCopyOptions
+Gets or sets the SqlBulkCopyOptions to use when `SqlBulkCopy` is used to directly insert in the destination table.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSaveChanges(options =>
+{
+ options.SqlBulkCopyOptions = SqlBulkCopyOptions.Default | SqlBulkCopyOptions.TableLock;
+});
+{% endhighlight %}
diff --git a/docs/pages/api/options-summary/options-temporary-table.md b/docs/pages/api/options-summary/options-temporary-table.md
new file mode 100644
index 0000000..600ee08
--- /dev/null
+++ b/docs/pages/api/options-summary/options-temporary-table.md
@@ -0,0 +1,80 @@
+---
+permalink: temporary-table
+---
+
+## TemporaryTableBatchByTable
+Gets or sets the number of batches a temporary table can contain. This option may create multiple temporary tables when the number of batches to execute exceeds the specified limit.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSaveChanges(options =>
+{
+ options.TemporaryTableBatchByTable = 0; // unlimited
+});
+{% endhighlight %}
+
+---
+
+## TemporaryTableInsertBatchSize
+Gets or sets the number of records to use in a batch when inserting in a temporary table. This number is recommended to be high.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSaveChanges(options =>
+{
+ options.TemporaryTableInsertBatchSize = 50000;
+});
+{% endhighlight %}
+
+---
+
+## TemporaryTableMinRecord
+Gets or sets the minimum number of records to use a temporary table instead of using SQL derived table.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSaveChanges(options =>
+{
+ options.TemporaryTableMinRecord = 25;
+});
+{% endhighlight %}
+
+---
+
+## TemporaryTableSchemaName
+Gets or sets the schema name to use for the temporary table.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSaveChanges(options =>
+{
+ options.TemporaryTableSchemaName = "zzz";
+});
+{% endhighlight %}
+
+---
+
+## TemporaryTableUseTableLock
+Gets or sets if the temporary table must be locked when inserting records into it.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSaveChanges(options =>
+{
+ options.TemporaryTableUseTableLock = true;
+});
+{% endhighlight %}
+
+
+---
+
+## UsePermanentTable
+Gets or sets if the library should `create` and `drop` a permanent table instead of using a temporary table.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSaveChanges(options =>
+{
+ options.UsePermanentTable = true;
+});
+{% endhighlight %}
diff --git a/docs/pages/api/options-summary/options-transient-error.md b/docs/pages/api/options-summary/options-transient-error.md
new file mode 100644
index 0000000..c78ff56
--- /dev/null
+++ b/docs/pages/api/options-summary/options-transient-error.md
@@ -0,0 +1,27 @@
+---
+permalink: transient-error
+---
+
+## RetryCount
+Gets or sets the maximum number of operations retry when a transient error occurs.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSaveChanges(options => {
+ options.RetryCount = 3;
+});
+{% endhighlight %}
+
+---
+
+## RetryInterval
+Gets or sets the interval to wait before retrying an operation when a transient error occurs.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSaveChanges(options => {
+ options.RetryCount = 3;
+ options.RetryInterval = new TimeSpan(100);
+});
+
+{% endhighlight %}
diff --git a/docs/pages/api/options-summary/transaction.md b/docs/pages/api/options-summary/transaction.md
new file mode 100644
index 0000000..f8a642f
--- /dev/null
+++ b/docs/pages/api/options-summary/transaction.md
@@ -0,0 +1,43 @@
+---
+permalink: transaction
+---
+
+## BulkSaveChanges
+As SaveChanges, BulkSaveChanges already save all entities within an internal transaction. So by default, there is nothing to do.
+
+However, if you start a transaction within Entity Framework, BulkSaveChanges will honor it and will use this transaction instead of creating an internal transaction.
+
+{% include template-example.html %}
+{% highlight csharp %}
+var transaction = context.Database.BeginTransaction();
+try
+{
+ context.BulkSaveChanges();
+ transaction.Commit();
+}
+catch
+{
+ transaction.Rollback();
+}
+{% endhighlight %}
+---
+
+## Bulk Operations
+Bulk Operations such as BulkInsert, BulkUpdate, BulkDelete doesn't use a transaction by default. This is your responsibility to handle it.
+
+If you start a transaction within Entity Framework, Bulk Operations will honor it.
+
+{% include template-example.html %}
+{% highlight csharp %}
+var transaction = context.Database.BeginTransaction();
+try
+{
+ context.BulkInsert(list1);
+ context.BulkInsert(list2);
+ transaction.Commit();
+}
+catch
+{
+ transaction.Rollback();
+}
+{% endhighlight %}
diff --git a/docs/pages/api/options/allow-concurrency.md b/docs/pages/api/options/allow-concurrency.md
new file mode 100644
index 0000000..9bec56a
--- /dev/null
+++ b/docs/pages/api/options/allow-concurrency.md
@@ -0,0 +1,5 @@
+---
+permalink: allow-concurrency
+---
+
+{% include under-construction.html %}
\ No newline at end of file
diff --git a/docs/pages/api/options/allow-duplicate-keys.md b/docs/pages/api/options/allow-duplicate-keys.md
new file mode 100644
index 0000000..3617e33
--- /dev/null
+++ b/docs/pages/api/options/allow-duplicate-keys.md
@@ -0,0 +1,19 @@
+---
+permalink: allow-duplicate-keys
+---
+
+## Definition
+Gets or sets if a duplicate key is possible in the source.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkMerge(list, options => options.AllowDuplicateKeys = true);
+{% endhighlight %}
+
+## Purpose
+In a rare scenario such as importing a file, a key may be used in multiple rows.
+
+In some provider such as SQL Server, the statement created by our library (`Merge`) makes it impossible to use with some duplicate keys.
+
+By enabling this option, only the latest key is used instead.
+
diff --git a/docs/pages/api/options/allow-update-primary-keys.md b/docs/pages/api/options/allow-update-primary-keys.md
new file mode 100644
index 0000000..dd4728f
--- /dev/null
+++ b/docs/pages/api/options/allow-update-primary-keys.md
@@ -0,0 +1,14 @@
+---
+permalink: allow-update-primary-keys
+---
+
+## Definition
+Gets or sets if the key must also be included in columns to `UPDATE`.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkMerge(list, options => options.AllowUpdatePrimaryKeys = true);
+{% endhighlight %}
+
+## Purpose
+This option is rarely used. One scenario example is a custom key with a trigger that requires columns part of the key to also be `UPDATED`.
\ No newline at end of file
diff --git a/docs/pages/api/options/audit-entries.md b/docs/pages/api/options/audit-entries.md
new file mode 100644
index 0000000..723a2a8
--- /dev/null
+++ b/docs/pages/api/options/audit-entries.md
@@ -0,0 +1,34 @@
+---
+permalink: audit-entries
+---
+
+## Definition
+Get `INSERTED` and `DELETED` data when `UseAudit` option is enabled.
+
+{% include template-example.html %}
+{% highlight csharp %}
+List auditEntries = new List();
+
+context.BulkSaveChanges(options =>
+{
+ options.UseAudit = true;
+ options.BulkOperationExecuted = bulkOperation => auditEntries.AddRange(bulkOperation.AuditEntries);
+});
+
+foreach (var entry in auditEntries)
+{
+ foreach (var value in entry.Values)
+ {
+ var oldValue = value.OldValue;
+ var newValue = value.NewValue;
+ }
+}
+{% endhighlight %}
+
+## Purpose
+Logging old value and new value is often useful to keep a history of changes in the database or file.
+
+## FAQ
+
+### Why enabling this option decreases the performance?
+Enabling this option will require additional data to be returned from the database.
\ No newline at end of file
diff --git a/docs/pages/api/options/batch-delay-interval.md b/docs/pages/api/options/batch-delay-interval.md
new file mode 100644
index 0000000..7faf201
--- /dev/null
+++ b/docs/pages/api/options/batch-delay-interval.md
@@ -0,0 +1,27 @@
+---
+permalink: batch-delay-interval
+---
+
+## Definition
+Gets or sets a delay in milliseconds to wait between batch.
+
+**DO NOT** use this options with transaction.
+
+{% include template-example.html %}
+{% highlight csharp %}
+// Instance
+context.BulkInsert(list, options => options.BatchDelayInterval = 100);
+
+// Global
+EntityFrameworkManager.BulkOperationBuilder = builder => builder.BatchDelayInterval = 100;
+{% endhighlight %}
+
+## Purpose
+Having access to add a delay interval between batches may help to give responsivity to other applications by giving them a chance to insert data during the delay time.
+
+## FAQ
+
+### Why should I not use this option with transaction?
+You should not because if may often lead to lock and deadlock.
+
+A transaction must be as short as possible and completed as soon as possible.
diff --git a/docs/pages/api/options/batch-size.md b/docs/pages/api/options/batch-size.md
new file mode 100644
index 0000000..123b939
--- /dev/null
+++ b/docs/pages/api/options/batch-size.md
@@ -0,0 +1,38 @@
+---
+permalink: batch-size
+---
+
+## Definition
+Gets or sets the number of records to use in a batch.
+
+{% include template-example.html %}
+{% highlight csharp %}
+// Instance
+context.BulkSaveChanges(options => options.BatchSize = 1000);
+
+// Global
+EntityFrameworkManager.BulkOperationBuilder = builder => builder.BatchSize = 1000;
+{% endhighlight %}
+
+## Purpose
+Having access to modify the `BatchSize` default value may be useful in some occasions where the performance is very affected.
+
+Don't try to optimize it if your application is not affected by performance problem.
+
+## FAQ
+
+### What's the optimized BatchSize?
+Not too low, not too high!
+
+Unfortunately, there is no magic value.
+
+If you set it too low, the library will perform too many round-trips and it may decreases the overall performance.
+
+If you set it too high, the library will make fewer round-trips but it could take more time to write on the server which may decrease the overall performance.
+
+There is no perfect number since there is too many factors such as:
+- Column Size
+- Index
+- Latency
+- Trigger
+- Etc.
\ No newline at end of file
diff --git a/docs/pages/api/options/batch-timeout.md b/docs/pages/api/options/batch-timeout.md
new file mode 100644
index 0000000..51803c8
--- /dev/null
+++ b/docs/pages/api/options/batch-timeout.md
@@ -0,0 +1,23 @@
+---
+permalink: batch-timeout
+---
+
+## Definition
+Gets or sets the maximum of time in seconds to wait for a batch before the command throws a timeout exception.
+
+{% include template-example.html %}
+{% highlight csharp %}
+// Instance
+context.BulkSaveChanges(options => options.BatchTimeout = 180);
+
+// Global
+EntityFrameworkManager.BulkOperationBuilder = builder => builder.BatchTimeout = 180;
+{% endhighlight %}
+
+## Purpose
+Having access to change the `BatchTimeout` gives you the flexibility required when some operations are too slow to complete due to several reasons such as:
+- Batch Size
+- Column Size
+- Latency
+- Trigger
+- Etc.
\ No newline at end of file
diff --git a/docs/pages/api/options/bulk-operation-executed.md b/docs/pages/api/options/bulk-operation-executed.md
new file mode 100644
index 0000000..1ad30cb
--- /dev/null
+++ b/docs/pages/api/options/bulk-operation-executed.md
@@ -0,0 +1,27 @@
+---
+permalink: bulk-operation-executed
+---
+
+## Definition
+Gets or sets an action to execute `after` the bulk operation is executed.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSaveChanges(options => {
+ options.BulkOperationExecuted = bulkOperation => { /* configuration */ };
+});
+{% endhighlight %}
+
+## Purpose
+For some options such as `Audit`, values must be taken directly from the `Bulk Operations` after it's executed. This `event` allows you to take this kind of information.
+
+{% include template-example.html %}
+{% highlight csharp %}
+List auditEntries = new List();
+
+context.BulkSaveChanges(list, options =>
+{
+ options.UseAudit = true;
+ options.BulkOperationExecuted = bulkOperation => auditEntries.AddRange(bulkOperation.AuditEntries);
+});
+{% endhighlight %}
\ No newline at end of file
diff --git a/docs/pages/api/options/bulk-operation-executing.md b/docs/pages/api/options/bulk-operation-executing.md
new file mode 100644
index 0000000..048f60e
--- /dev/null
+++ b/docs/pages/api/options/bulk-operation-executing.md
@@ -0,0 +1,16 @@
+---
+permalink: bulk-operation-executing
+---
+
+## Definition
+Gets or sets an action to execute `before` the bulk operation is executed.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSaveChanges(options => {
+ options.BulkOperationExecuting = bulkOperation => { /* configuration */ };
+});
+{% endhighlight %}
+
+## Purpose
+This event allows you to check or change some options that have been automatically added when none is specified such as Batch Size, Column Mapping, Timeout, etc.
diff --git a/docs/pages/api/options/column-input-expression.md b/docs/pages/api/options/column-input-expression.md
new file mode 100644
index 0000000..1732cdc
--- /dev/null
+++ b/docs/pages/api/options/column-input-expression.md
@@ -0,0 +1,20 @@
+---
+permalink: column-input-expression
+---
+
+## Definition
+Gets or sets columns to map with the direction `Input`.
+
+The key is required for operations such as `BulkUpdate` and `BulkMerge`.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkMerge(list, options =>
+ options.ColumnInputExpression = entity => new {entity.ID, entity.Code}
+);
+{% endhighlight %}
+
+## Purpose
+The `ColumnInputExpression` option lets you choose specific properties in which you want to perform the bulk operations.
+
+By example, when importing a file, you may not have data on all properties.
\ No newline at end of file
diff --git a/docs/pages/api/options/column-input-output-expression.md b/docs/pages/api/options/column-input-output-expression.md
new file mode 100644
index 0000000..f12cfd3
--- /dev/null
+++ b/docs/pages/api/options/column-input-output-expression.md
@@ -0,0 +1,20 @@
+---
+permalink: column-input-output-expression
+---
+
+## Definition
+Gets or sets columns to map with the direction `InputOutput`.
+
+The key is required for operations such as `BulkUpdate` and `BulkMerge`.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkMerge(list, options =>
+ options.ColumnInputOutputExpression = entity => new {entity.ID, entity.Code}
+);
+{% endhighlight %}
+
+## Purpose
+The `ColumnInputOutputExpression` option lets you choose specific properties in which you want to perform the bulk operations.
+
+By example, when importing a file, you may have not data on all properties.
\ No newline at end of file
diff --git a/docs/pages/api/options/column-output-expression.md b/docs/pages/api/options/column-output-expression.md
new file mode 100644
index 0000000..ff19289
--- /dev/null
+++ b/docs/pages/api/options/column-output-expression.md
@@ -0,0 +1,16 @@
+---
+permalink: column-output-expression
+---
+
+## Definition
+Gets or sets columns to map with the direction `Output`.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkMerge(list, options =>
+ options.ColumnOutputExpression = entity => new {entity.ModifiedDate, entity.ModifiedUser}
+);
+{% endhighlight %}
+
+## Purpose
+The `ColumnOutputExpression` option lets you choose specific properties in which you want to retrieve data from the database.
\ No newline at end of file
diff --git a/docs/pages/api/options/column-primary-key-expression.md b/docs/pages/api/options/column-primary-key-expression.md
new file mode 100644
index 0000000..02c4297
--- /dev/null
+++ b/docs/pages/api/options/column-primary-key-expression.md
@@ -0,0 +1,18 @@
+---
+permalink: column-primary-key-expression
+---
+
+## Definition
+Gets or sets columns to use as the `key` for the operation.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkMerge(list, options =>
+ options.ColumnPrimaryKeyExpression = entity => new { entity.Code1, entity.Code2 }
+);
+{% endhighlight %}
+
+## Purpose
+The `ColumnPrimaryKeyExpression` option lets you choose a specific key to use to perform the bulk operations.
+
+By example, when importing a file, you may not have access to the `ID` but a unique `Code` instead.
\ No newline at end of file
diff --git a/docs/pages/api/options/ingore-on-merge-insert-expression.md b/docs/pages/api/options/ingore-on-merge-insert-expression.md
new file mode 100644
index 0000000..6f0e792
--- /dev/null
+++ b/docs/pages/api/options/ingore-on-merge-insert-expression.md
@@ -0,0 +1,25 @@
+---
+permalink: ignore-on-merge-insert-expression
+---
+
+## Definition
+Gets or sets columns to ignore when the `BulkMerge` method executes the `insert` statement.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkMerge(list, options =>
+ options.IgnoreOnMergeUpdateExpression = entity => new {entity.ModifiedDate, entity.ModifiedUser}
+);
+{% endhighlight %}
+
+## Purpose
+The `IgnoreOnMergeInsertExpression` option lets you ignore some columns that should only be `updated.
+
+By example, when to `update` the ModifiedData and ModifiedUser but not `insert` value.
+
+## Limitations
+Database Provider Supported:
+- SQL Server
+- SQL Azure
+
+_Ask our support team if you need this option for another provider_
\ No newline at end of file
diff --git a/docs/pages/api/options/ingore-on-merge-update-expression.md b/docs/pages/api/options/ingore-on-merge-update-expression.md
new file mode 100644
index 0000000..0d31fe1
--- /dev/null
+++ b/docs/pages/api/options/ingore-on-merge-update-expression.md
@@ -0,0 +1,25 @@
+---
+permalink: ignore-on-merge-update-expression
+---
+
+## Definition
+Gets or sets columns to ignore when the `BulkMerge` method executes the `update` statement.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkMerge(list, options =>
+ options.IgnoreOnMergeUpdateExpression = entity => new {entity.CreatedDate, entity.CreatedDate}
+);
+{% endhighlight %}
+
+## Purpose
+The `IgnoreOnMergeUpdateExpression` option lets you ignore some columns that should be only `insert.
+
+By example, when you need to `insert` the CreatedDate and CreatedDate but not `update` the value.
+
+## Limitations
+Database Provider Supported:
+- SQL Server
+- SQL Azure
+
+_Ask our support team if you need this option for another provider_
\ No newline at end of file
diff --git a/docs/pages/api/options/insert-keep-identity.md b/docs/pages/api/options/insert-keep-identity.md
new file mode 100644
index 0000000..67c9d8f
--- /dev/null
+++ b/docs/pages/api/options/insert-keep-identity.md
@@ -0,0 +1,16 @@
+---
+permalink: insert-keep-identity
+---
+
+## Definition
+Gets or sets if the source identity value should be preserved on `Insert`. When not specified, identity values are assigned by the destination.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.Insert(options => options.InsertKeepIdentity = true);
+{% endhighlight %}
+
+## Purpose
+The `InsertKeepIdentity` option let you keep the source identity value when `inserting`.
+
+By example, when importing a file, you may want to keep the value specified.
\ No newline at end of file
diff --git a/docs/pages/api/options/log-dump.md b/docs/pages/api/options/log-dump.md
new file mode 100644
index 0000000..436e4da
--- /dev/null
+++ b/docs/pages/api/options/log-dump.md
@@ -0,0 +1,21 @@
+---
+permalink: log-dump
+---
+
+## Definition
+Gets all `logged` database event when `UseLogDump` is enabled.
+
+{% include template-example.html %}
+{% highlight csharp %}
+StringBuilder logDump;
+
+context.BulkSaveChanges(options =>
+{
+ options.UseLogDump = true;
+ options.BulkOperationExecuted = bulkOperation => logDump = bulkOperation.LogDump;
+});
+{% endhighlight %}
+
+
+## Purpose
+Getting database `log` can often be useful for debugging and see what has been executed under the hood by the library.
\ No newline at end of file
diff --git a/docs/pages/api/options/log.md b/docs/pages/api/options/log.md
new file mode 100644
index 0000000..c59d527
--- /dev/null
+++ b/docs/pages/api/options/log.md
@@ -0,0 +1,19 @@
+---
+permalink: log
+---
+
+## Definition
+Gets or sets an action to `log` all database events as soon as they happen.
+
+{% include template-example.html %}
+{% highlight csharp %}
+StringBuilder logger = new StringBuilder();
+
+context.BulkSaveChanges(options =>
+{
+ options.Log += s => logger.AppendLine(s);
+});
+{% endhighlight %}
+
+## Purpose
+Getting database `log` can often be useful for debugging and see what has been executed under the hood by the library.
\ No newline at end of file
diff --git a/docs/pages/api/options/merge-keep-identity.md b/docs/pages/api/options/merge-keep-identity.md
new file mode 100644
index 0000000..a42f62e
--- /dev/null
+++ b/docs/pages/api/options/merge-keep-identity.md
@@ -0,0 +1,16 @@
+---
+permalink: merge-keep-identity
+---
+
+## Definition
+Gets or sets if the source identity value should be preserved on `Merge`. When not specified, identity values are assigned by the destination.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkMerge(options => options.MergeKeepIdentity = true);
+{% endhighlight %}
+
+## Purpose
+The `MergeKeepIdentity` option lets you keep the source identity value when `merging`.
+
+By example, when importing a file, you may want to keep the specified value.
\ No newline at end of file
diff --git a/docs/pages/api/options/retry-count.md b/docs/pages/api/options/retry-count.md
new file mode 100644
index 0000000..c39ca7f
--- /dev/null
+++ b/docs/pages/api/options/retry-count.md
@@ -0,0 +1,29 @@
+---
+permalink: retry-count
+---
+
+## Definition
+Gets or sets the maximum number of operations retry when a transient error occurs.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSaveChanges(options => {
+ options.RetryCount = 3;
+});
+{% endhighlight %}
+
+## Purpose
+A transient error is a temporary error that is likely to disappear soon. That rarely happens but they might occur!
+
+These options allow to reduce a bulk operations fail by making them retry when a transient error occurs.
+
+## FAQ
+
+### What are transient error codes supported?
+You can find a list of transient errors here: [Transient fault error codes](https://docs.microsoft.com/en-us/azure/sql-database/sql-database-develop-error-messages#transient-fault-error-codes)
+
+Which includes the most common errors such as:
+- Cannot open database
+- The service is currently busy
+- Database is not currently available
+- Not enough resources to process request
\ No newline at end of file
diff --git a/docs/pages/api/options/retry-interval.md b/docs/pages/api/options/retry-interval.md
new file mode 100644
index 0000000..4c0f78f
--- /dev/null
+++ b/docs/pages/api/options/retry-interval.md
@@ -0,0 +1,31 @@
+---
+permalink: retry-interval
+---
+
+## Definition
+Gets or sets the interval to wait before retrying an operation when a transient error occurs.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSaveChanges(options => {
+ options.RetryCount = 3;
+ options.RetryInterval = new TimeSpan(100);
+});
+
+{% endhighlight %}
+
+## Purpose
+A transient error is a temporary error that is likely to disappear soon. That rarely happens but they might occur!
+
+These options allow to reduce a bulk operations fail by making them retry when a transient error occurs.
+
+## FAQ
+
+### What are transient error codes supported?
+You can find a list of transient errors here: [Transient fault error codes](https://docs.microsoft.com/en-us/azure/sql-database/sql-database-develop-error-messages#transient-fault-error-codes)
+
+Which includes the most common error such as:
+- Cannot open database
+- The service is currently busy
+- Database is not currently available
+- Not enough resources to process request
\ No newline at end of file
diff --git a/docs/pages/api/options/sql-bulk-copy-options.md b/docs/pages/api/options/sql-bulk-copy-options.md
new file mode 100644
index 0000000..d1902d6
--- /dev/null
+++ b/docs/pages/api/options/sql-bulk-copy-options.md
@@ -0,0 +1,17 @@
+---
+permalink: sql-bulk-copy-options
+---
+
+## Definition
+Gets or sets the SqlBulkCopyOptions to use when `SqlBulkCopy` is used to directly insert in the destination table.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSaveChanges(options =>
+{
+ options.SqlBulkCopyOptions = SqlBulkCopyOptions.Default | SqlBulkCopyOptions.TableLock;
+});
+{% endhighlight %}
+
+## Purpose
+Modifying the SqlBulkCopyOptions to include by example `TableLock` may increase significantly the performance.
\ No newline at end of file
diff --git a/docs/pages/api/options/synchronize-keep-identity.md b/docs/pages/api/options/synchronize-keep-identity.md
new file mode 100644
index 0000000..4f9a39a
--- /dev/null
+++ b/docs/pages/api/options/synchronize-keep-identity.md
@@ -0,0 +1,16 @@
+---
+permalink: synchronize-keep-identity
+---
+
+## Definition
+Gets or sets if the source identity value should be preserved on `Synchronize`. When not specified, identity values are assigned by the destination.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSynchronize(options => options.SynchronizeKeepIdentity = true);
+{% endhighlight %}
+
+## Purpose
+The `SynchronizeKeepIdentity` option let you keep the source identity value when `synchronizing`.
+
+By example, when importing a file, you may want to keep the value specified.
\ No newline at end of file
diff --git a/docs/pages/api/options/temporary-table-batch-by-table.md b/docs/pages/api/options/temporary-table-batch-by-table.md
new file mode 100644
index 0000000..42d9ddc
--- /dev/null
+++ b/docs/pages/api/options/temporary-table-batch-by-table.md
@@ -0,0 +1,17 @@
+---
+permalink: temporary-table-batch-by-table
+---
+
+## Definition
+Gets or sets the number of batches a temporary table can contain. This option may create multiple temporary tables when the number of batches to execute exceeds the limit specified.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSaveChanges(options =>
+{
+ options.TemporaryTableBatchByTable = 0; // unlimited
+});
+{% endhighlight %}
+
+## Purpose
+So far, we have not found any scenario that could require it. But we still support this option!
\ No newline at end of file
diff --git a/docs/pages/api/options/temporary-table-insert-batch-size.md b/docs/pages/api/options/temporary-table-insert-batch-size.md
new file mode 100644
index 0000000..ad54cff
--- /dev/null
+++ b/docs/pages/api/options/temporary-table-insert-batch-size.md
@@ -0,0 +1,17 @@
+---
+permalink: temporary-table-insert-batch-size
+---
+
+## Definition
+Gets or sets the number of records to use in a batch when inserting in a temporary table. This number is recommended to be high.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSaveChanges(options =>
+{
+ options.TemporaryTableInsertBatchSize = 50000;
+});
+{% endhighlight %}
+
+## Purpose
+Increasing the default value may improve the performance. Since the temporary table doesn't contain index and trigger and it's normally locked during the insert, you may use a very high value.
\ No newline at end of file
diff --git a/docs/pages/api/options/temporary-table-min-record.md b/docs/pages/api/options/temporary-table-min-record.md
new file mode 100644
index 0000000..df14925
--- /dev/null
+++ b/docs/pages/api/options/temporary-table-min-record.md
@@ -0,0 +1,17 @@
+---
+permalink: temporary-table-min-record
+---
+
+## Definition
+Gets or sets the minimum number of records to use a temporary table instead of using SQL derived table.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSaveChanges(options =>
+{
+ options.TemporaryTableMinRecord = 25;
+});
+{% endhighlight %}
+
+## Purpose
+Our library is smart but finding the `META` number is very hard since there is a lot of factors. Increasing the default value may improve the performance.
\ No newline at end of file
diff --git a/docs/pages/api/options/temporary-table-schema-name.md b/docs/pages/api/options/temporary-table-schema-name.md
new file mode 100644
index 0000000..c64b413
--- /dev/null
+++ b/docs/pages/api/options/temporary-table-schema-name.md
@@ -0,0 +1,17 @@
+---
+permalink: temporary-table-schema-name
+---
+
+## Definition
+Gets or sets the schema name to use for the temporary table.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSaveChanges(options =>
+{
+ options.TemporaryTableSchemaName = "zzz";
+});
+{% endhighlight %}
+
+## Purpose
+In very rare occasions, you may need to specify a schema name. By example, when also using `UsePermanentTable` option.
\ No newline at end of file
diff --git a/docs/pages/api/options/temporary-table-use-table-lock.md b/docs/pages/api/options/temporary-table-use-table-lock.md
new file mode 100644
index 0000000..c4a586f
--- /dev/null
+++ b/docs/pages/api/options/temporary-table-use-table-lock.md
@@ -0,0 +1,17 @@
+---
+permalink: temporary-table-use-table-lock
+---
+
+## Definition
+Gets or sets if the temporary table must be locked when inserting records into it.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSaveChanges(options =>
+{
+ options.TemporaryTableUseTableLock = true;
+});
+{% endhighlight %}
+
+## Purpose
+Using table lock increases the overall performance when inserting into a temporary table. This option should not be disabled.
\ No newline at end of file
diff --git a/docs/pages/api/options/use-audit.md b/docs/pages/api/options/use-audit.md
new file mode 100644
index 0000000..d9492c2
--- /dev/null
+++ b/docs/pages/api/options/use-audit.md
@@ -0,0 +1,25 @@
+---
+permalink: use-audit
+---
+
+## Definition
+Gets or sets if `INSERTED` and `DELETED` data from the database should be returned as `AuditEntries`.
+
+{% include template-example.html %}
+{% highlight csharp %}
+List auditEntries = new List();
+
+context.BulkSaveChanges(options =>
+{
+ options.UseAudit = true;
+ options.BulkOperationExecuted = bulkOperation => auditEntries.AddRange(bulkOperation.AuditEntries);
+});
+{% endhighlight %}
+
+## Purpose
+Logging old values and new values is often useful to keep history of changes in the database or file.
+
+## FAQ
+
+### Why enabling this option decreases the performance?
+Enabling this option will require additional data to be returned from the database.
\ No newline at end of file
diff --git a/docs/pages/api/options/use-log-dump.md b/docs/pages/api/options/use-log-dump.md
new file mode 100644
index 0000000..2e3ab9f
--- /dev/null
+++ b/docs/pages/api/options/use-log-dump.md
@@ -0,0 +1,20 @@
+---
+permalink: use-log-dump
+---
+
+## Definition
+Gets or sets if all `log` related to database event should be stored in a `LogDump` property.
+
+{% include template-example.html %}
+{% highlight csharp %}
+StringBuilder logDump;
+
+context.BulkSaveChanges(options =>
+{
+ options.UseLogDump = true;
+ options.BulkOperationExecuted = bulkOperation => logDump = bulkOperation.LogDump;
+});
+{% endhighlight %}
+
+## Purpose
+Getting database `log` can often be useful for debugging and see what has been executed under the hood by the library.
\ No newline at end of file
diff --git a/docs/pages/api/options/use-permanent-table.md b/docs/pages/api/options/use-permanent-table.md
new file mode 100644
index 0000000..4b51369
--- /dev/null
+++ b/docs/pages/api/options/use-permanent-table.md
@@ -0,0 +1,17 @@
+---
+permalink: use-permanent-table
+---
+
+## Definition
+Gets or sets if the library should `create` and `drop` a permanent table instead of using a temporary table.
+
+{% include template-example.html %}
+{% highlight csharp %}
+context.BulkSaveChanges(options =>
+{
+ options.UsePermanentTable = true;
+});
+{% endhighlight %}
+
+## Purpose
+This option can be useful when for some rare reasons, you don't have access to the `tempdb` database.
\ No newline at end of file
diff --git a/docs/pages/api/update-from-query.md b/docs/pages/api/update-from-query.md
new file mode 100644
index 0000000..81aed23
--- /dev/null
+++ b/docs/pages/api/update-from-query.md
@@ -0,0 +1,41 @@
+---
+permalink: update-from-query
+---
+
+## Definition
+`UPDATE` all rows from the database using a LINQ Query without loading entities in the context.
+
+An `UPDATE` statement is built using the LINQ expression and directly executed in the database.
+
+{% include template-example.html %}
+{% highlight csharp %}
+// UPDATE all customers that are inactive for more than two years
+context.Customers
+ .Where(x => x.Actif && x.LastLogin < DateTime.Now.AddYears(-2))
+ .UpdateFromQuery(x => new Customer {Actif = false});
+
+// UPDATE customers by id
+context.Customers.Where(x => x.ID == userId).UpdateFromQuery(x => new Customer {Actif = false});
+{% endhighlight %}
+
+## Purpose
+`Updating` entities using `SaveChanges` normally requires to load them first in the `ChangeTracker`. These additional round-trips are often not necessary.
+
+`UpdateFromQuery` gives you access to directly execute an `UPDATE` statement in the database and provide a **HUGE** performance improvement.
+
+## Performance Comparisons
+
+| Operations | 1,000 Entities | 2,000 Entities | 5,000 Entities |
+| :-------------- | -------------: | -------------: | -------------: |
+| SaveChanges | 1,000 ms | 2,000 ms | 5,000 ms |
+| UpdateFromQuery | 1 ms | 1 ms | 1 ms |
+
+{% include section-faq-begin.html %}
+## FAQ
+
+### Why UpdateFromQuery is faster than SaveChanges, BulkSaveChanges, and BulkUpdate?
+
+`UpdateFromQuery` executes a statement directly in SQL such as `UPDATE [TableName] SET [SetColumnsAndValues] WHERE [Key]`.
+
+Other operations normally require one or multiple database round-trips which makes the performance slower.
+{% include section-faq-end.html %}
\ No newline at end of file
diff --git a/docs/pages/articles/articles.md b/docs/pages/articles/articles.md
new file mode 100644
index 0000000..61e9033
--- /dev/null
+++ b/docs/pages/articles/articles.md
@@ -0,0 +1,12 @@
+---
+permalink: articles
+---
+
+You got some articles idea you will want we write?
+
+Contact us: info@zzzprojects.com
+
+Tell us about your daily problem or your performance issue.
+
+We will be happy to help you and share the solution to make developer code better and faster!
+
diff --git a/docs/pages/articles/benchmark.md b/docs/pages/articles/benchmark.md
new file mode 100644
index 0000000..91e4f0d
--- /dev/null
+++ b/docs/pages/articles/benchmark.md
@@ -0,0 +1,132 @@
+---
+permalink: benchmark
+---
+
+## Problem
+You perform benchmark tests for a method like BulkSaveChanges, but you get very bad performance results.
+
+### Solution
+The performance issue may be caused by some common mistakes:
+
+- Forget to JIT compile the library
+- Include method not related to the test
+
+
+
+## Forget to JIT compile the library
+In C#, the code is compiled into IL by the compiler. Then when needed, the IL is compiled just-in-time (JIT) into the native assembly language of the host machine.
+
+Additionally, some libraries like Entity Framework require some extra work like creating/reading the model. Some people report the first load taking several seconds!
+
+Entity Framework Extensions also takes some time to be compiled. It can take around 100ms the first time you use a method! So if you include it this time, your benchmark time is currently way higher than it should.
+
+### Solution
+Invoke the method once before performing the benchmark tests
+
+## Include method not related to the test
+Someone once reported a performance issue and thought our BulkSaveChanges method was slow. We discovered he was including the time to Add every entity to the context.
+
+The Add method was taking 99,9% of the total time while BulkSaveChanges only 0,1%.
+
+
+| Operations | 100 Entities | 1,000 Entities | 10,000 Entities |
+| :--------- | -----------: | -------------: | --------------: |
+| Add | 15 ms | 1,050 ms | 105,000 ms |
+| BulKSaveChanges | 40 ms | 90ms | 400 ms |
+
+
+The Add method doesn't affect much the performance when adding 100 entities, but if you make your test with 10,000 entities:
+ - Add: 99.6%
+ - BulkSaveChanges: 0,4%
+
+### Solution
+Include only the method you want to benchmark.
+
+## Good Example
+Here is an example of how we normally do all our benchmarks tests
+
+### Example
+{% include template-example.html %}
+{% highlight csharp %}
+public Benchmark()
+{
+ // BENCHMARK using Stopwatch
+ var clock1 = new Stopwatch();
+ var clock2 = new Stopwatch();
+
+ var nbRecord = 1000;
+ var nbTry = 5;
+
+ var list = GenerateData(nbRecord);
+
+ // BENCHMARK: JIT compile library first
+ Test1(list, null);
+ Test2(list, null);
+
+ for (var i = 0; i < nbTry; i++)
+ {
+ Test1(list, clock1);
+ Test2(list, clock2);
+ }
+
+ var r1 = clock1.ElapsedMilliseconds/nbTry;
+ var r2 = clock2.ElapsedMilliseconds/nbTry;
+}
+
+public void Test1(List lines, Stopwatch clock)
+{
+ using (var ctx = new CustomerContext())
+ {
+ var customers = new List();
+
+ foreach (var line in lines)
+ {
+ var customer = new Customer();
+ // ...code...
+ customers.Add(customer);
+ }
+
+ ctx.Customers.AddRange(customers);
+
+ // BENCHMARK: Only method we want to test
+ clock.Start();
+ ctx.BulkSaveChanges();
+ clock.Stop();
+ }
+}
+
+public void Test2(List lines, Stopwatch clock)
+{
+ using (var ctx = new CustomerContext())
+ {
+ var customers = new List();
+
+ foreach (var line in lines)
+ {
+ var customer = new Customer();
+ // ...code...
+ customers.Add(customer);
+ }
+
+ ctx.Customers.AddRange(customers);
+
+ // BENCHMARK: Only method we want to test
+ clock.Start();
+ ctx.SaveChanges();
+ clock.Stop();
+ }
+}
+
+public List GenerateData(int nbRecord)
+{
+ var list = new List();
+
+ for (var i = 0; i < nbRecord; i++)
+ {
+ list.Add(i.ToString());
+ }
+
+ return list;
+}
+{% endhighlight %}
+
diff --git a/docs/pages/articles/bulk-insert-vs-bulk-savechanges.md b/docs/pages/articles/bulk-insert-vs-bulk-savechanges.md
new file mode 100644
index 0000000..33ecdf7
--- /dev/null
+++ b/docs/pages/articles/bulk-insert-vs-bulk-savechanges.md
@@ -0,0 +1,39 @@
+---
+permalink: bulk-insert-vs-bulk-savechanges
+---
+
+## What’s the difference between BulkInsert and BulkSaveChanges?
+BulkInsert will always be a lot faster than BulkSaveChanges.
+
+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.
+
+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.
+
+## Should I always use BulkInsert?
+No! Even if BulkInsert is faster.
+
+BulkSaveChanges even if slower make everything easier. All you need to do is adding “Bulk” before “SaveChanges” and everything work as expected.
+
+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.
+
+## We normally recommend always to use BulkSaveChanges unless you have some critical section you want to boost even more the performance.
+How is transaction handled?
+
+BulkSaveChanges as SaveChanges create an internal transaction. So, by default, there is nothing to do.
+
+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.
+
+{% include template-example.html %}
+{% highlight csharp %}
+var transaction = context.Database.BeginTransaction();
+try
+{
+ context.BulkInsert(list1);
+ context.BulkInsert(list2);
+ transaction.Commit();
+}
+catch
+{
+ transaction.Rollback();
+}
+{% endhighlight %}
diff --git a/docs/pages/articles/concurrency.md b/docs/pages/articles/concurrency.md
new file mode 100644
index 0000000..7909192
--- /dev/null
+++ b/docs/pages/articles/concurrency.md
@@ -0,0 +1,208 @@
+---
+permalink: concurrency
+---
+
+## Problem
+Your model have concurrency entity and you must resolve optimistic concurrency using a pattern.
+
+Concurrency exceptions normally happen on:
+- BulkSaveChanges
+- BulkUpdate
+
+## Solution - BulkSaveChanges
+When a concurrency error happens, only the first entry in error is returned (exactly like SaveChanges).
+
+There are three possible scenarios:
+- Database Wins (You keep database values)
+- Client Wins (You keep current entity values)
+- Custom Resolution (You merge properties from database and client entity)
+
+### Database Wins
+You keep database values.
+
+{% include template-example.html %}
+{% highlight csharp %}
+public void BulkSaveChanges_DatabaseWins(DbContext ctx)
+{
+ bool saveFailed;
+
+ do
+ {
+ saveFailed = false;
+
+ try
+ {
+ ctx.BulkSaveChanges();
+ }
+ catch (DbUpdateConcurrencyException ex)
+ {
+ saveFailed = true;
+
+ // Update the values of the entity that failed to save from the store
+ ex.Entries.Single().Reload();
+ }
+
+ } while (saveFailed);
+}
+{% endhighlight %}
+
+### Client Wins
+You keep current entity values.
+
+{% include template-example.html %}
+{% highlight csharp %}
+public void BulkSaveChanges_ClientWins(DbContext ctx)
+{
+ bool saveFailed;
+
+ do
+ {
+ saveFailed = false;
+
+ try
+ {
+ ctx.BulkSaveChanges();
+ }
+ catch (DbUpdateConcurrencyException ex)
+ {
+ saveFailed = true;
+
+ // Update original values from the database
+ var entry = ex.Entries.Single();
+ entry.OriginalValues.SetValues(entry.GetDatabaseValues());
+ }
+
+ } while (saveFailed);
+}
+{% endhighlight %}
+
+### Custom Resolution
+You merge properties from database and client entity.
+
+{% include template-example.html %}
+{% highlight csharp %}
+public void BulkSaveChanges_CustomResolution(CurrentContext ctx)
+ {
+public void BulkSaveChanges_CustomResolution(CurrentContext ctx)
+{
+
+ bool saveFailed;
+
+ do
+ {
+ saveFailed = false;
+
+ try
+ {
+ ctx.BulkSaveChanges();
+ }
+ catch (DbUpdateConcurrencyException ex)
+ {
+ saveFailed = true;
+
+ // Get the current entity values and the values in the database
+ // as instances of the entity type
+ var entry = ex.Entries.Single();
+ var databaseValues = entry.GetDatabaseValues();
+
+ if (entry.Entity is EntitySimple_Concurrency)
+ {
+ var clientEntity = (EntitySimple_Concurrency) entry.Entity;
+ var databaseEntity = (EntitySimple_Concurrency) databaseValues.ToObject();
+
+ // Choose an initial set of resolved values. In this case we
+ // make the default be the values currently in the database.
+ var resolvedEntity = (EntitySimple_Concurrency) databaseValues.ToObject();
+
+ // Have the user choose what the resolved values should be
+ resolvedEntity.IntColumn = clientEntity.IntColumn + 100;
+ // ... merge all columns...
+
+ // Update the original values with the database values and
+ // the current values with whatever the user chooses.
+ entry.OriginalValues.SetValues(databaseValues);
+ entry.CurrentValues.SetValues(resolvedEntity);
+ }
+ }
+
+ } while (saveFailed);
+}
+{% endhighlight %}
+
+## Solution - BulkUpdate
+When a concurrency error happens, BulkUpdate returns a **DbBulkOperationConcurrencyException** which contains all entries in error.
+
+There are three possible scenarios:
+- Database Wins (You keep database values)
+- Client Wins (You keep current entity values)
+- Custom Resolution (You merge properties from database and client entity)
+
+### Database Wins
+You keep database values.
+
+{% include template-example.html %}
+{% highlight csharp %}
+public void BulkUpdate_DatabaseWins(CurrentContext ctx, List list) where T : class
+{
+ try
+ {
+ ctx.BulkUpdate(list);
+ }
+ catch (DbBulkOperationConcurrencyException ex)
+ {
+ // DO nothing (or log), keep database values!
+ }
+}
+{% endhighlight %}
+
+### Client Wins
+You keep current entity values.
+
+{% include template-example.html %}
+{% highlight csharp %}
+public void BulkUpdate_StoreWins(CurrentContext ctx, List list) where T : class
+{
+ try
+ {
+ ctx.BulkUpdate(list);
+ }
+ catch (DbBulkOperationConcurrencyException ex)
+ {
+ // FORCE update store entities
+ ctx.BulkUpdate(list, operation => operation.AllowConcurrency = false);
+ }
+}
+{% endhighlight %}
+
+### Custom Resolution
+You merge properties from database and client entity.
+
+{% include template-example.html %}
+{% highlight csharp %}
+public void BulkUpdate_CustomResolution(CurrentContext ctx, List list) where T : class
+{
+ try
+ {
+ ctx.BulkUpdate(list);
+ }
+ catch (DbBulkOperationConcurrencyException ex)
+ {
+ foreach (var entry in ex.Entries)
+ {
+ ObjectStateEntry objectEntry;
+
+ if (entry is EntitySimple_Concurrency)
+ {
+ var clientEntry = (EntitySimple_Concurrency) entry;
+ var databaseEntry = ctx.EntitySimple_Concurrencys.Single(x => x.ID == clientEntry.ID);
+
+ // merge properties like you want
+ clientEntry.IntColumn = databaseEntry.IntColumn;
+ }
+ }
+
+ // FORCE update store entities
+ ctx.BulkUpdate(list, operation => operation.AllowConcurrency = false);
+ }
+}
+{% endhighlight %}
diff --git a/docs/pages/articles/custom-column.md b/docs/pages/articles/custom-column.md
new file mode 100644
index 0000000..3bdbbdf
--- /dev/null
+++ b/docs/pages/articles/custom-column.md
@@ -0,0 +1,42 @@
+---
+permalink: custom-column
+---
+
+## Problem
+You want to perform a Bulk Operations (BulkInsert, BulkUpdate, BulkDelete, or BulkMerge) but only on some specific columns.
+
+By example, you want to perform a BulkUpdate on a customer list but only UPDATE the name and email property.
+
+## Solution
+You can specify the column on which the operation should be performed with the **ColumnInputExpression** options
+
+### Example
+
+{% include template-example.html %}
+{% highlight csharp %}
+// DON'T add the key if auto-generated
+ctx.BulkInsert(customers, operation => operation.ColumnInputExpression =
+ customer => new {customer.Name, customer.Email});
+
+// ALWAYS add the key
+ctx.BulkUpdate(customers, operation => operation.ColumnInputExpression =
+ customer => new { customer.ID, customer.Name, customer.Email });
+
+// ALWAYS add the key
+ctx.BulkMerge(customers, operation => operation.ColumnInputExpression =
+ customer => new {customer.ID, customer.Name, customer.Email});
+{% endhighlight %}
+
+## Troubleshooting
+
+### INSERT + Destination mapped more than once error
+You receive the following error:
+> One of your columns has a destination mapped more than once. See the inner exception for details.
+
+Make sure the key has not been added to the ColumnInputExpression.
+
+### UPDATE or MERGE + No primary found
+You receive the following error:
+> An error occurred, no primary could be found or resolved.
+
+Make sure the key has been added to the ColumnInputExpression.
diff --git a/docs/pages/articles/custom-key.md b/docs/pages/articles/custom-key.md
new file mode 100644
index 0000000..cb8a209
--- /dev/null
+++ b/docs/pages/articles/custom-key.md
@@ -0,0 +1,53 @@
+---
+permalink: custom-key
+---
+
+## Problem
+You want to perform a Bulk Operations (BulkUpdate, BulkDelete, or BulkMerge) but using a different key than the one specifyied.
+
+By example, you want to perform a BulkUpdate on a customer list but using the customer "Code" instead of the "CustomerID" for the key.
+
+## Solution
+You can specify the column to use for the key with the **ColumnPrimaryKeyExpression** options.
+
+### Example
+
+{% include template-example.html %}
+{% highlight csharp %}
+// Single Key
+ctx.BulkUpdate(customers, operation => operation.ColumnPrimaryKeyExpression =
+ customer => customer.Code);
+
+// Surrogate Key (with anonymous type)
+ctx.BulkUpdate(customers, operation => operation.ColumnPrimaryKeyExpression =
+ customer => new { customer.Code1, customer.Code2, customer.Code3 });
+{% endhighlight %}
+
+## Troubleshooting
+
+### Duplicate Key
+You receive the following error:
+> An error occurred because the primary key specified is not unique, you can set the property 'AllowDuplicateKeys' to true to allow duplicate keys
+
+This error happens because the key is used in more than one row in the source
+
+#### Example
+
+| Code | Name |
+| :--- | :---- |
+| 001 | Jon |
+| 002 | Henri |
+| 001 | Jonathan |
+
+The code "001" is here more than once with a different name.
+
+You can allow duplicate key with the **AllowDuplicateKeys** options
+
+{% include template-example.html %}
+{% highlight csharp %}
+ctx.BulkUpdate(customers, operation =>
+{
+ operation.AllowDuplicateKeys = true;
+ operation.ColumnPrimaryKeyExpression = customer => customer.Code;
+});
+{% endhighlight %}
diff --git a/docs/pages/articles/emdx.md b/docs/pages/articles/emdx.md
new file mode 100644
index 0000000..683b11e
--- /dev/null
+++ b/docs/pages/articles/emdx.md
@@ -0,0 +1,35 @@
+---
+permalink: edmx
+---
+
+In a rare occasion, your model might not still compatible yet with our model reader. If that's your case and we ask you for your model, you can use one of the following methods to provide the required information:
+
+## Code First
+Use the `GetModelXDocument` method to generate the Edmx to send.
+
+{% include template-example.html %}
+{% highlight csharp %}
+public string GetModelXDocument(DbContext context)
+{
+ XDocument doc;
+ using (var memoryStream = new MemoryStream())
+ {
+ using (XmlWriter xmlWriter = XmlWriter.Create(memoryStream, new XmlWriterSettings { Indent = true }))
+ {
+ EdmxWriter.WriteEdmx(context, xmlWriter);
+ }
+
+ memoryStream.Position = 0;
+
+ doc = XDocument.Load(memoryStream);
+ }
+ return doc.ToString();
+}
+
+DbContext context = new EntityContext();
+string edmx = GetModelXDocument();
+{% endhighlight %}
+
+
+## Database First
+Provide us the [fileName].edmx directly.
diff --git a/docs/pages/articles/fastest-way-to-insert.md b/docs/pages/articles/fastest-way-to-insert.md
new file mode 100644
index 0000000..fcf85ed
--- /dev/null
+++ b/docs/pages/articles/fastest-way-to-insert.md
@@ -0,0 +1,172 @@
+---
+permalink: fastest-way-to-insert
+---
+
+## What’s the FASTEST way to insert in Entity Framework?
+
+This question keeps getting asked a few times every week on Stack Overflow.
+Most common solutions usually involve:
+
+- Using AddRange over Add method
+- Calling SaveChanges every X entities
+- Creating a new context every X entities
+- Disabling Change Detection
+- Disabling Change Validation
+- Disabling Proxy
+
+Some of these solutions are good, some lead to side impacts and none of them fix the main issue: One database round-trip is made for every entity you save!
+So if you have 5000 entities to insert, 5000 databases round trips will be executed which is **INSANELY** slow.
+
+A very common mistake is believing the AddRange method perform a Bulk Insert. Using the AddRange method greatly improve the performance because it calls the DetectChanges method only once after all entities are added to the change tracker. However, the SaveChanges method will still make one database round-trip per entity.
+
+### Solution
+To solve the performance problem, you need to reduce the number of database round-trips, and this is exactly what Entity Framework Extensions made by ZZZ Projects do by providing the BulkInsert method and all other bulk operations:
+
+- [BulkSaveChanges](#ef-bulksavechanges)
+- [BulkInsert](#ef-bulkinsert)
+- [BullUpdate](#ef-bulkupdate)
+- [BulkDelete](#ef-bulkdelete)
+- [BulkMerge](#ef-bulkmerge)
+
+With this library, only a few database round-trips will now be required when saving 5000 entities which can lead to performance improvement by 50x times and more.
+
+You can find the library documentation here: [EFE – Tutorials](http://entityframework-extensions.net/tutorials)
+
+Getting started with this library could not be easier. You download it using [NuGet](https://www.nuget.org/packages/Z.EntityFramework.Extensions/){:target="_blank"}, and all bulk methods are automatically available from your context instance since methods extend the DbContext class.
+
+Without having to configure anything, all models and scenarios are supported such as Code First, Database First, Inheritances (TPC, TPH, and TPT), Relationship, and everything else!
+
+## EF BulkSaveChanges
+BulkSaveChanges method works like SaveChanges but performs save operations (INSERT, UPDATE, and DELETE) way faster.
+There are multiple options available such as:
+
+- Disable Concurrency Check
+- Disable Entity Framework Propagation for better performance
+- Update Modified values only
+
+This method is normally recommended over bulk methoda such as Bulk Insert since it acts like SaveChanges by using the Change Tracker and propagating the value.
+
+Tutorial: [EFE – Bulk SaveChanges](http://entityframework-extensions.net/bulk-savechanges)
+
+### Example
+```csharp
+ctx.BulkSaveChanges();
+
+ctx.BulkSaveChanges(useEntityFrameworkPropagation: false);
+
+ctx.BulkSaveChanges(options =>
+{
+ options.AllowConcurrency = false;
+ options.ForceUpdateUnmodifiedValues = false;
+});
+```
+
+## EF BulkInsert
+BulkInsert method performs an INSERT operation and outputs the identity value.
+There are multiple options available such as:
+
+- Custom Column
+- Disabled output value for better performance
+- Insert only entities that don't already exists
+- Keep Identity Value
+
+Bulk Insert is faster than BulkSaveChanges. However, Bulk Insert doesn’t use the Change Tracker so identity value propagation may differ. If you need to perform multiple bulk operations with some relation, it’s recommended to use BulkSaveChanges instead.
+
+Tutorial: [EFE – Bulk Insert](http://entityframework-extensions.net/bulk-insert)
+
+### Example
+```csharp
+ctx.BulkInsert(customers);
+
+ctx.BulkInsert(customers, options =>
+{
+ options.ColumnInputExpression = x => new {x.Code, x.Email};
+ options.AutoMapOutputDirection = false;
+ options.InsertIfNotExists = true;
+ options.InsertKeepIdentity = true;
+});
+```
+
+## EF BulkUpdate
+BulkUpdate method performs an UPDATE operation.
+
+Tutorial: [EFE – Bulk Update](http://entityframework-extensions.net/bulk-update)
+
+There are multiple options available such:
+
+- Custom Column
+- Custom Key
+- Disable Concurrency Check
+
+### Example
+```csharp
+ctx.BulkUpdate(customers, options =>
+{
+ options.ColumnInputExpression = x => new { x.Code, x.Email };
+ options.ColumnPrimaryKeyExpression = x => new { x.Code };
+ options.AllowConcurrency = false;
+});
+```
+
+## EF BulkDelete
+BulkDelete method performs a DELETE operation.
+
+There are multiple options available such as:
+
+- Custom Key
+- Disable Concurrency Check
+
+Tutorial: [EFE – Bulk Delete](http://entityframework-extensions.net/bulk-delete)
+
+### Example
+```csharp
+ctx.BulkDelete(list);
+
+ctx.BulkDelete(list, options =>
+{
+ options.ColumnPrimaryKeyExpression = x => new { x.Code };
+ options.AllowConcurrency = false;
+});
+```
+
+## EF BulkMerge
+BulkMerge method performs an UPSERT operation and outputs the identity value. Existing entities matching the key are updated, and newly entities are inserted.
+
+There are multiple options available such as:
+
+- Custom Column
+- Custom Column (Insert Only)
+- Custom Column (Update Only)
+- Custom Key
+- Disabled output value for better performance
+- Keep Identity Value
+
+Tutorial: [EFE – Bulk Merge](http://entityframework-extensions.net/bulk-merge)
+
+### Example
+```csharp
+ctx.BulkMerge(list);
+
+ctx.BulkMerge(list, options =>
+{
+ options.ColumnInputExpression = x => new { x.Code, x.CreatedDate, x.UpdatedDate };
+ options.IgnoreOnMergeInsertExpression = x => new { x. UpdatedDate };
+ options.IgnoreOnMergeUpdateExpression = x => new { x.ID, x.CreatedDate };
+ options.ColumnPrimaryKeyExpression = x => new { x.Code };
+ options.AutoMapOutputDirection = false;
+ options.MergeKeepIdentity = true;
+});
+```
+
+## Conclusion
+Entity Framework Extensions is well tested with over 10k unit tests and currently used by thousands of company all around the world. Without a doubt, it is the ultimate library to improve your performance with Entity Framework.
+
+On the negative side, this library is not free.
+
+ZZZ Projects gives back value to the .NET community by supporting some other free libraries, tutorials and sponsoring project such as:
+
+- [Entity Framework Plus](http://entityframework-plus.net/){:target="_blank"}
+- [Html Agility Pack](http://html-agility-pack.net/){:target="_blank"}
+- [Extension Methods](https://github.com/zzzprojects/Z.ExtensionMethods){:target="_blank"}
+- [Dapper Tutorial](http://dapper-tutorial.net/){:target="_blank"}
+- Help partners like [Entity Framework Tutorial](http://www.entityframeworktutorial.net/){:target="_blank"}
diff --git a/docs/pages/articles/improve-bulk-savechanges.md b/docs/pages/articles/improve-bulk-savechanges.md
new file mode 100644
index 0000000..26e75cd
--- /dev/null
+++ b/docs/pages/articles/improve-bulk-savechanges.md
@@ -0,0 +1,55 @@
+---
+permalink: improve-bulk-savechanges
+---
+
+## Introduction
+BulkSaveChanges is already very fast. But you can make it even faster by simply turning off the "EntityFrameworkPropagation" options.
+
+While the performance will be significantly increased, this option works with 99,9% of models. Unfortunately, we cannot turn this option on by default for backward compatibility until we make it work with all models
+
+We are currently working on the next major version which will have even better performances!
+
+[Learn - Why turning off Entity Framework Propagation is faster](#why-turning-off-entity-framework-propagation-is-faster)
+
+### Example - Globally
+{% include template-example.html %}
+{% highlight csharp %}
+EntityFrameworkManager.DefaultEntityFrameworkPropagationValue = false;
+{% endhighlight %}
+
+### Example - By Instance
+{% include template-example.html %}
+{% highlight csharp %}
+var ctx = new EntitiesContext();
+
+ctx.Customers.AddRange(listToAdd);
+ctx.Customers.RemoveRange(listToRemove);
+listToModify.ForEach(x => x.DateModified = DateTime.Now);
+
+// Easy to use
+ctx.BulkSaveChanges(false);
+{% endhighlight %}
+
+### Performance Comparisons
+
+| Operations | 1,000 Entities | 2,000 Entities | 5,000 Entities |
+| :-------------- | -------------: | -------------: | -------------: |
+| SaveChanges | 1,000 ms | 2,000 ms | 5,000 ms |
+| BulkSaveChanges() | 90 ms | 150 ms | 350 ms |
+| BulkSaveChanges(false) | 60 ms | 70 ms | 140 ms |
+
+For SQL Server, performance improvement is around 2x faster.
+
+For some provider like SQLite, performance improvement can be as high as 10x faster.
+
+### Unsupported Scenario
+
+- There is too much cross reference table, and the library is not able to create a saving strategy. You will receive an error on the first use.
+- An entity uses a temporary generated GUID when adding (not empty), but the GUID is replaced later by the GUID generated in the database. Data will be correctly inserted, but entities may still have the temporary GUID for relation not using navigation property.
+
+> These limitations will be fixed in the next major version.
+
+## Why turning off Entity Framework Propagation is faster
+Unfortunately, Entity Framework is very slow at generating commands to be executed. For some providers, it takes more time to generate these queries than executing them!
+
+When turning off, the library does no longer use the methods from Entity Framework but internal methods from our library.
diff --git a/docs/pages/articles/soft-delete.md b/docs/pages/articles/soft-delete.md
new file mode 100644
index 0000000..d6770b5
--- /dev/null
+++ b/docs/pages/articles/soft-delete.md
@@ -0,0 +1,111 @@
+---
+permalink: soft-delete
+---
+
+## Problem
+You want to soft delete some entities currently in deleted state with BulkSaveChanges.
+
+{% include template-example.html %}
+{% highlight csharp %}
+using (var ctx = new CurrentContext())
+{
+ var lastLogin = DateTime.Now.AddYears(-2);
+ var list = ctx.Customers.Where(x => x.LastLogin < lastLogin).ToList();
+ ctx.Customers.RemoveRange(list);
+
+ // HOW to automatically handle soft delete?
+ ctx.BulkSaveChanges();
+}
+{% endhighlight %}
+
+### Solution
+You can use the **EntityFrameworkManager.PreBulkSaveChanges** property to change state & value from entities prior to the BulkSaveChanges execution
+
+### Example
+
+{% include template-example.html %}
+{% highlight csharp %}
+EntityFrameworkManager.PreBulkSaveChanges = context =>
+{
+ foreach (var entry in context.ChangeTracker.Entries())
+ {
+ if (entry.State == EntityState.Deleted && entry.Entity is Customer)
+ {
+ entry.State = EntityState.Modified;
+ ((Customer) entry.Entity).IsDeleted = true;
+ }
+ }
+};
+
+using (var ctx = new CurrentContext())
+{
+ var lastLogin = DateTime.Now.AddYears(-2);
+ var list = ctx.Customers.Where(x => x.LastLogin < lastLogin).ToList();
+ ctx.Customers.RemoveRange(list);
+ ctx.BulkSaveChanges();
+}
+{% endhighlight %}
+
+## Problem
+You want to soft delete some entities currently in deleted state with BulkDelete.
+
+{% include template-example.html %}
+{% highlight csharp %}
+using (var ctx = new CurrentContext())
+{
+ var lastLogin = DateTime.Now.AddYears(-2);
+ var list = ctx.Customers.Where(x => x.LastLogin < lastLogin).ToList();
+
+ // HOW to automatically handle soft delete?
+ ctx.BulkDelete(list);
+}
+{% endhighlight %}
+
+### Solution
+Unfortunately, there is no way to SoftDelete using BulkDelete. Since BulkDelete doesn't use ChangeTracker for optimization reasons, you will have to implement yourself an extension method to handle this scenario.
+
+### Example
+
+{% include template-example.html %}
+{% highlight csharp %}
+public static class Extensions
+{
+ public static void BulkHardOrSoftDelete(this DbContext ctx, IEnumerable items) where T : class
+ {
+ var hardDelete = new List();
+ var softDelete = new List();
+
+ foreach (var item in items)
+ {
+ var customer = item as Customer;
+ if (customer != null)
+ {
+ customer.IsDeleted = true;
+ softDelete.Add(item);
+ }
+ else
+ {
+ hardDelete.Add(item);
+ }
+ }
+
+ if (hardDelete.Count > 0)
+ {
+ ctx.BulkDelete(hardDelete);
+ }
+ if (softDelete.Count > 0)
+ {
+ ctx.BulkUpdate(softDelete);
+ }
+ }
+}
+
+using (var ctx = new CurrentContext())
+{
+ var lastLogin = DateTime.Now.AddYears(-2);
+ var list = ctx.Customers.Where(x => x.LastLogin < lastLogin).ToList();
+
+ ctx.BulkHardOrSoftDelete(list);
+}
+{% endhighlight %}
+
diff --git a/docs/pages/faq/faq-general.md b/docs/pages/faq/faq-general.md
new file mode 100644
index 0000000..c59b71d
--- /dev/null
+++ b/docs/pages/faq/faq-general.md
@@ -0,0 +1,20 @@
+---
+permalink: faq-general
+---
+
+## Which Payment method do you support?
+We support the following payment method:
+
+- PayPal
+- Check
+- Bank Transfer
+
+## Can I purchase this product from a Reseller?
+Yes, just let him know to contact us.
+
+## What's your average SLA response and resolution time?
+We try to provide an outstanding support service.
+
+We normally answer very fast, often within one hour.
+
+Most fixes are resolved within one business day.
diff --git a/docs/pages/faq/faq-installation.md b/docs/pages/faq/faq-installation.md
new file mode 100644
index 0000000..dd0aff2
--- /dev/null
+++ b/docs/pages/faq/faq-installation.md
@@ -0,0 +1,12 @@
+---
+permalink: faq-installation
+---
+
+## How to install your product?
+It is simple, you download it from NuGet and add it to your project.
+
+More Info: [Tutorials - Installing](installing)
+
+## I have installed your product, but I don't see your extensions method
+- Make sure to install it in the right project
+- Make sure your project support .NET40 or better
diff --git a/docs/pages/faq/faq-license.md b/docs/pages/faq/faq-license.md
new file mode 100644
index 0000000..896ab0d
--- /dev/null
+++ b/docs/pages/faq/faq-license.md
@@ -0,0 +1,76 @@
+---
+permalink: faq-license
+---
+
+## Developer Seat
+
+### What's a developer seat?
+A developer seat is a developer working for your company and developing code directly with our product.
+
+You don't have to purchase developer seat for front-end developer or back-end developer which doesn't use our product API.
+
+Since you buy developer seats, you can develop an unlimited amount of projects within your company.
+
+### What's the cost for additional developer seats?
+The cost for additional developer seats is usually extremely low. We want to make sure our library is accessible for small and large company.
+
+### Are developer seats transferable?
+Yes, a developer seat can be transferred to any employee within your company.
+
+## Perpertual License
+
+### What's a perpetual license?
+A perpetual license allows you to use the licensed product indefinitely.
+
+### Even when my Support & Upgrade is expired?
+Yes.
+
+## Support & Upgdrade
+
+### My support & upgrade period is expired! What will happen?
+Don't worry. Your product keeps on working forever!
+
+You can still download and use any version released before the support & upgrade expiration date.
+
+You will need to renew your license to use version released after the support & upgrade expiration date.
+
+### How do I renew my License?
+We usually start to send renewal mails two months before the support & upgrade expiry date.
+
+If you didn't receive such email, you could contact us directly: info@zzzprojects.com
+
+### Can I have a renewal discount?
+We provide a 25% discount to early renewal. Anyone renewing before the support & upgrade expiration date automatically gets a renewal discount.
+
+### I'm too late for early renewal discount! What can I do?
+If you are few days late, we still provide early renewal discount.
+
+However, if you have few months late, you will need to purchase the library again.
+
+The best way to find out if you still have access to early renewal discount is by contacting us: info@zzzprojects.com
+
+### Why should I renew?
+Renewing your support & upgrade gives the following benefits:
+
+- Major version releases and new product features
+- Fast support by mail
+- Protection against price increases during the maintenance term
+
+## Royalty Free
+
+### Can I install Entity Framework Extensions on Client Machine?
+Yes, the product is royalty free.
+
+That means, you paid for developer seat, but customers using your product don't have to pay us.
+
+### Is Entity Framework Extensions Royalty Free?
+Yes, the product is royalty free.
+
+This mean, you can develop a project and install it on thousands of clients.
+
+You paid for developer seat within your company.
+
+Some standard royalty free limitations:
+
+- You can't sell a similar product and claim it's yours.
+- If your customer has access to your source code and develops using our API, they will have to purchase a license.
diff --git a/docs/pages/faq/faq.md b/docs/pages/faq/faq.md
new file mode 100644
index 0000000..3f2e027
--- /dev/null
+++ b/docs/pages/faq/faq.md
@@ -0,0 +1,8 @@
+---
+permalink: faq
+---
+
+- [General](faq-general)
+- [Installation](faq-installation)
+- [Issue Tracker](issue-tracker)
+- [License](faq-license)
\ No newline at end of file
diff --git a/docs/pages/faq/issue-tracker.md b/docs/pages/faq/issue-tracker.md
new file mode 100644
index 0000000..9f0602c
--- /dev/null
+++ b/docs/pages/faq/issue-tracker.md
@@ -0,0 +1,13 @@
+---
+permalink: issue-tracker
+---
+
+## Where is your Issue Tracker?
+
+While we prefer to be contacted directly: info@zzzprojects.com
+
+We understand some people prefer to have an online issue tracker to follow and comment their issues.
+
+You can create an issue here:
+
+- [Issue Tracker](https://github.com/zzzprojects/EntityFramework-Extensions/issues)
diff --git a/docs/pages/problems/dbbulkoperationconcurrency-exception.md b/docs/pages/problems/dbbulkoperationconcurrency-exception.md
new file mode 100644
index 0000000..2dec19c
--- /dev/null
+++ b/docs/pages/problems/dbbulkoperationconcurrency-exception.md
@@ -0,0 +1,89 @@
+---
+permalink: dbbulkoperationconcurrency-exception
+---
+
+## Problem
+
+You execute a method from the Entity Framework Extensions library, and the following error is thrown:
+
+- Type: DbBulkOperationConcurrencyException
+
+{% include template-exception.html message='A concurrency exception has occured. Entities may have been modified or deleted since entities were loaded.' %}
+
+## Solution
+
+### Cause
+
+Another thread already performed the operation.
+
+### Fix
+
+There are three possible resolutions:
+
+- Database Win
+- Client Win
+- Custom Resolution
+
+#### Database Win
+{% include template-example.html %}
+{% highlight csharp %}
+public void BulkUpdate_DatabaseWins(CurrentContext ctx, List list) where T : class
+{
+ try
+ {
+ ctx.BulkUpdate(list);
+ }
+ catch (DbBulkOperationConcurrencyException ex)
+ {
+ // DO nothing (or log), keep database values!
+ }
+}
+{% endhighlight %}
+
+#### Client Win
+{% include template-example.html %}
+{% highlight csharp %}
+public void BulkUpdate_StoreWins(CurrentContext ctx, List list) where T : class
+{
+ try
+ {
+ ctx.BulkUpdate(list);
+ }
+ catch (DbBulkOperationConcurrencyException ex)
+ {
+ // FORCE update store entities
+ ctx.BulkUpdate(list, operation => operation.AllowConcurrency = false);
+ }
+}
+{% endhighlight %}
+
+#### Custom Resolution
+{% include template-example.html %}
+{% highlight csharp %}
+public void BulkUpdate_CustomResolution(CurrentContext ctx, List list) where T : class
+{
+ try
+ {
+ ctx.BulkUpdate(list);
+ }
+ catch (DbBulkOperationConcurrencyException ex)
+ {
+ foreach (var entry in ex.Entries)
+ {
+ ObjectStateEntry objectEntry;
+
+ if (entry is EntitySimple_Concurrency)
+ {
+ var clientEntry = (EntitySimple_Concurrency) entry;
+ var databaseEntry = ctx.EntitySimple_Concurrencys.Single(x => x.ID == clientEntry.ID);
+
+ // merge properties like you want
+ clientEntry.IntColumn = databaseEntry.IntColumn + 303;
+ }
+ }
+
+ // FORCE update store entities
+ ctx.BulkUpdate(list, operation => operation.AllowConcurrency = false);
+ }
+}
+{% endhighlight %}
diff --git a/docs/pages/problems/dbupdateconcurrency-exception.md b/docs/pages/problems/dbupdateconcurrency-exception.md
new file mode 100644
index 0000000..811ea3c
--- /dev/null
+++ b/docs/pages/problems/dbupdateconcurrency-exception.md
@@ -0,0 +1,129 @@
+---
+permalink: dbupdateconcurrency-exception
+---
+
+## Problem
+
+You execute a method from the Entity Framework Extensions library, and the following error is thrown:
+
+- Type: DbUpdateConcurrencyException
+
+{% include template-exception.html message='Store update, insert, or delete statement affected an unexpected number of rows ([row count]). Entities may have been modified or deleted since entities were loaded. See http://go.microsoft.com/fwlink/?LinkId=472540 for information on understanding and handling optimistic concurrency exceptions.' %}
+
+## Solution
+
+### Cause
+
+Another thread have already performed the operation.
+
+### Fix
+
+There are three possible resolutions:
+
+- Database Win
+- Client Win
+- Custom Resolution
+
+#### Database Win
+{% include template-example.html %}
+{% highlight csharp %}
+public void BulkSaveChanges_DatabaseWins(DbContext ctx)
+{
+ bool saveFailed;
+
+ do
+ {
+ saveFailed = false;
+
+ try
+ {
+ ctx.BulkSaveChanges();
+ }
+ catch (DbUpdateConcurrencyException ex)
+ {
+ saveFailed = true;
+
+ // Update the values of the entity that failed to save from the store
+ ex.Entries.Single().Reload();
+ }
+
+ } while (saveFailed);
+}
+{% endhighlight %}
+
+#### Client Win
+{% include template-example.html %}
+{% highlight csharp %}
+public void BulkSaveChanges_ClientWins(DbContext ctx)
+{
+ bool saveFailed;
+
+ do
+ {
+ saveFailed = false;
+
+ try
+ {
+ ctx.BulkSaveChanges();
+ }
+ catch (DbUpdateConcurrencyException ex)
+ {
+ saveFailed = true;
+
+ // Update original values from the database
+ var entry = ex.Entries.Single();
+ entry.OriginalValues.SetValues(entry.GetDatabaseValues());
+ }
+
+ } while (saveFailed);
+}
+{% endhighlight %}
+
+#### Custom Resolution
+{% include template-example.html %}
+{% highlight csharp %}
+public void BulkSaveChanges_CustomResolution(CurrentContext ctx)
+{
+
+ bool saveFailed;
+
+ do
+ {
+ saveFailed = false;
+
+ try
+ {
+ ctx.BulkSaveChanges();
+ }
+ catch (DbUpdateConcurrencyException ex)
+ {
+ saveFailed = true;
+
+ // Get the current entity values and the values in the database
+ // as instances of the entity type
+ var entry = ex.Entries.Single();
+ var databaseValues = entry.GetDatabaseValues();
+
+ if (entry.Entity is EntitySimple_Concurrency)
+ {
+ var clientEntity = (EntitySimple_Concurrency) entry.Entity;
+ var databaseEntity = (EntitySimple_Concurrency) databaseValues.ToObject();
+
+ // Choose an initial set of resolved values. In this case we
+ // make the default be the values currently in the database.
+ var resolvedEntity = (EntitySimple_Concurrency) databaseValues.ToObject();
+
+ // Have the user choose what the resolved values should be
+ resolvedEntity.IntColumn = clientEntity.IntColumn + 100;
+ // ... merge all columns...
+
+ // Update the original values with the database values and
+ // the current values with whatever the user chooses.
+ entry.OriginalValues.SetValues(databaseValues);
+ entry.CurrentValues.SetValues(resolvedEntity);
+ }
+ }
+
+ } while (saveFailed);
+}
+{% endhighlight %}
diff --git a/docs/pages/problems/foreign-key-constraint-autodetectchanges-disabled.md b/docs/pages/problems/foreign-key-constraint-autodetectchanges-disabled.md
new file mode 100644
index 0000000..7a01c98
--- /dev/null
+++ b/docs/pages/problems/foreign-key-constraint-autodetectchanges-disabled.md
@@ -0,0 +1,42 @@
+---
+permalink: foreign-key-constraint-autodetectchanges-disabled
+---
+
+## Problem
+
+You execute a method from the Entity Framework Extensions library, and the following error is thrown:
+
+{% include template-exception.html message='The MERGE statement conflicted with the FOREIGN KEY constraint "[FK_Name]". The conflict occurred in database "[Database_Name]", table "[Table_Name]", column \'[Column_Name]\'.' %}
+
+And you use a code similar to this:
+
+{% include template-example.html %}
+{% highlight csharp %}
+using (var ctx = new MyEntities())
+{
+ ctx.Configuration.AutoDetectChangesEnabled = false;
+ ctx.Categories.AddRange(categories);
+ ctx.Items.AddRange(items);
+ ctx.BulkSaveChanges();
+}
+{% endhighlight %}
+
+## Solution
+
+### Cause
+
+One cause could be simply a wrong save order provided by either Entity Framework or EFE Library.
+
+### Cause Source
+The main reason that could cause this issue is disabling AutoDetectChanges and not enabling it before the SaveChanges/BulkSaveChanges.
+
+When the AutoDetectChanges is disabled, there is no check about the relationship, and that could cause sometimes the item to be added before a new Category (Which should be added first)! Leading to the Foreign Key issue.
+
+In additional, there is no reason why this code should disable DetectChanges. Since the AddRange method is used, the “DetectChanges” method is called only once per AddRange call, so don't suffer from a performance issue.
+
+### Fix
+
+1. ADD the line AutoDectectChangesEnabled = true; before BulkSaveChanges
+2. CALL ctx.ChangeTracker.DetectChanges();
+3. REMOVE the line AutoDetectChangesEnabled = false;
+
diff --git a/docs/pages/problems/md5-exception.md b/docs/pages/problems/md5-exception.md
new file mode 100644
index 0000000..c9545e7
--- /dev/null
+++ b/docs/pages/problems/md5-exception.md
@@ -0,0 +1,27 @@
+---
+permalink: md5-exception
+---
+
+## Problem
+
+You execute a method from the Entity Framework Extensions library, and the following error is thrown:
+
+{% include template-exception.html message='This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms.' %}
+
+## Solution
+
+### Cause
+
+The default algorithm to validate the license key & name is not supported with FIPS enabled.
+
+### Fix
+
+#### Ask for a compatible key
+
+Contact us and we will send you a new key supporting FIPS: {% include infozzzprojects-email.html %}
+
+Why don’t we generated key compatible with FIPS by default? Because it will not be supported for a client machine with Windows XP or below.
+
+#### Disable FIPS
+
+Article: [Disable FIPS](http://docs.trendmicro.com/all/ent/sc/v3.0/en-US/cmcolh/t_fips.html){:target="_blank"}
diff --git a/docs/pages/problems/out-of-memory.md b/docs/pages/problems/out-of-memory.md
new file mode 100644
index 0000000..25c8c6b
--- /dev/null
+++ b/docs/pages/problems/out-of-memory.md
@@ -0,0 +1,36 @@
+---
+permalink: out-of-memory
+---
+
+## Problem
+
+You execute a method from the Entity Framework Extensions library, and the following error is thrown:
+
+{% include template-exception.html message='An exception of type `System.OutOfMemoryException` occured in...' %}
+
+## Cause
+That error is caused when the library consumes too much memory.
+
+Most of the time, this error is caused by some methods used from `Entity Framework` for command generations that will be used later by our library.
+
+### Fix
+Turning off Entity Framework Propagation
+
+This solution work with around 99% of model. By turning off this options, our library doesn’t longer use several methods from Entity Framework that consume high memory such as the command generations.
+
+See: Improve BulkSaveChanges
+
+### Bulk Operations
+In some exceptional scenario, using Bulk Operations such as:
+
+- BulkInsert
+- BulkUpdate
+- BulkDelete
+- BulkMerge
+
+might may a better idea. They are faster and consume way less memory than BulkSaveChanges.
+
+### Reduce the number of entities in the ChangeTracker
+Another way is to make sure the ChangeTracker doesn’t contain too many entities.
+
+The ChangeTracker has not been build to support millions entities.
\ No newline at end of file
diff --git a/docs/pages/problems/problems.md b/docs/pages/problems/problems.md
new file mode 100644
index 0000000..eaf2c32
--- /dev/null
+++ b/docs/pages/problems/problems.md
@@ -0,0 +1,9 @@
+---
+permalink: problems
+---
+
+You got a problem or a question you didn’t find an answer here?
+
+Contact us: info@zzzprojects.com
+
+We usually answer within the next business day, hour, or minutes!
diff --git a/docs/pages/problems/trial-period-expired-exception.md b/docs/pages/problems/trial-period-expired-exception.md
new file mode 100644
index 0000000..fcf2c86
--- /dev/null
+++ b/docs/pages/problems/trial-period-expired-exception.md
@@ -0,0 +1,35 @@
+---
+permalink: trial-period-expired-exception
+---
+
+## Problem
+
+You execute a method from the Entity Framework Extensions library, and the following error is thrown:
+
+{% include template-exception.html message='ERROR_005: The monthly trial period is expired. You can extend your trial by downloading the latest version. You can also purchase a perpetual license on our website. If you already own this license, this error only appears if the license has not been found, you can find additional information on our troubleshooting section (http://entityframework-extensions.net/troubleshooting). Contact our support team for more details: info@zzzprojects.com' %}
+
+## Solution
+
+### Cause
+
+- You are currently evaluating the library and the trial period is expired.
+- You have purchased the license but didn't register it correctly.
+- You called methods from the library before registering the license.
+
+### Fix
+
+#### Trial Period Expired
+
+You can extend your trial by downloading the latest version: [Upgrading](http://entityframework-extensions.net/upgrading)
+
+The latest version always contains a trial for the current month to allow companies to evaluate our library for several months.
+
+#### License Badly Registered
+
+Make sure to follow all recommendations about how to setup your license: [Licensing](http://entityframework-extensions.net/licensing)
+
+#### Method called before registering
+
+Make sure to register your license before calling any other methods from our library. Otherwise, you could enable the trial period instead.
+
+Make sure to follow all recommendations about how to setup your license: [Licensing](http://entityframework-extensions.net/licensing)
diff --git a/docs/pages/problems/type-not-supported-exception.md b/docs/pages/problems/type-not-supported-exception.md
new file mode 100644
index 0000000..a473592
--- /dev/null
+++ b/docs/pages/problems/type-not-supported-exception.md
@@ -0,0 +1,20 @@
+---
+permalink: type-not-supported-exception
+---
+
+## Problem
+
+You execute a method from the Entity Framework Extensions library, and the following error is thrown:
+
+{% include template-exception.html message='Type not supported yet (LazyType): [TypeName]' %}
+
+## Solution
+
+### Cause
+
+For some provider, we may have missed a few types. They are added on demand.
+
+### Fix
+Contact our support team with the provider && type name: info@zzzprojects.com
+
+We usually fix && test this kind of issue within 24h
diff --git a/docs/pages/site/contact-us.md b/docs/pages/site/contact-us.md
new file mode 100644
index 0000000..51edcc0
--- /dev/null
+++ b/docs/pages/site/contact-us.md
@@ -0,0 +1,101 @@
+---
+permalink: contact-us
+---
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{% include section-faq-begin.html %}
+
+### I have a question! How should I contact you?
+{:.show}
+Contact us directly: info@zzzprojects.com
+
+Whether you need more personal help to get started or you just wanted to give us your opinion on the library, we love to hear from you!
+
+You can also find some answers on:
+- [Issues Tracker](https://github.com/zzzprojects/EntityFramework-Extensions/issues){:target="_blank"}
+- [Stack Overflow](https://stackoverflow.com/questions/tagged/entity-framework-extensions){:target="_blank"}
+
+### I think I've found a bug, where should I report it?
+The best way to report an issue is using our [Issues Tracker](https://github.com/zzzprojects/EntityFramework-Extensions/issues){:target="_blank"}
+
+Make sure to include:
+- Entity Framework Version
+- Entity Framework Extensions Version
+- Database Provider
+
+You can always contact us directly:
+
+- If you want a more personal answer
+- If your question is not suited for the Issue Tracker
+- If your message contains private information
+
+### I need a feature your library is lacking. Can I recommend it?
+If your project requests a feature we haven’t thought of, please let us know using our [Issues Tracker](https://github.com/zzzprojects/EntityFramework-Extensions/issues){:target="_blank"}
+
+We will develop and implement it as soon as possible, sometimes the same day. You could also contact us directly:
+
+- If you want a more personal answer
+- If your question is not suited for the Issue Tracker
+- If your message contains private information
+
+### I'm not fluent in English! How can we communicate?
+
+We prefer to keep all communications in either:
+- English
+- French
+
+But thanks for Google Translate, we can understand each other worldwide:
+- Chinese
+- Spanish
+- Hindi
+- Etc.
+
+We will do our best to accommodate you.
+
+{% include section-faq-end.html %}
+
+
+ Make sure to contact us, we are always here to help you.
+ info@zzzprojects.com
+
+
+
+
+
+
+
+
+---
+## FAQ
+
+### How can I extend my trial?
+The latest version always contains a trial that expires at the end of the month. You can extend your trial for several months by downloading the latest version at the begining of every month.
+
+### Why this library is not free and open source?
+`ZZZ Projects` mission is focused on adding value to the `.NET Community` and supporting a lot of `free and open source` libraries.
+
+However, this mission cannot be successful without being able to pay our developers for the time they pass to support & develop features for free and paid libraries.
+
+#### Free Librairies
+
+- [Html Agility Pack](http://html-agility-pack.net/){:target="_blank"}
+- [Entity Framework Plus](http://entityframework-plus.net/){:target="_blank"}
+- [Entity Framework DynamicFilter](https://github.com/zzzprojects/EntityFramework.DynamicFilters){:target="_blank"}
+- [RefactorThis.GraphDiff](https://github.com/zzzprojects/GraphDiff){:target="_blank"}
+- [Extension Methods](https://github.com/zzzprojects/Z.ExtensionMethods){:target="_blank"}
+
+#### Website
+
+- [.NET Fiddle](https://dotnetfiddle.net/){:target="_blank"}
+- [SQL Fiddle](http://sqlfiddle.com/){:target="_blank"}
+- [NuGet Must Haves](http://nugetmusthaves.com/){:target="_blank"}
+- [Dapper Tutorial](http://dapper-tutorial.net/){:target="_blank"}
+
+By contributing on paid libraries, you are also helping in keeping other libraries and website FREE.
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/pages/site/pricing.md b/docs/pages/site/pricing.md
new file mode 100644
index 0000000..ae4cff8
--- /dev/null
+++ b/docs/pages/site/pricing.md
@@ -0,0 +1,154 @@
+---
+permalink: pricing
+---
+
+
+
+
+
+
+
License Agreement
+
+
+ You must read and agree to the License Agreement.
+
Extend your trial for several months by downloading the latest version at the begining of every month.
+
License
+ The license include:
+
+
All bulk extensions methods
+
Commercial License
+
Royalty-Free
+
Perpetual Licenses
+
Support & Upgrades (1 year)
+
+
Question
+
Contact us: {% include mail-sales.html %}
+
+
+
+
+
+
+---
+
+
+{% include section-faq-begin.html %}
+
+## FAQ
+
+### Which payment alternative methods are accepted?
+We accept `PayPal`, `Cheque` and `Wire Transfer`.
+
+We **DO NOT** accept bitcoins and credit cards.
+
+Please contact us for more information.
+
+Email: sales@zzzprojects.com
+
+### Do you accept resellers?
+Yes contact us if you are a reseller or seeking for a reseller.
+
+Email: sales@zzzprojects.com
+
+### What 2-4 developer seats mean?
+It mean that you can use the license with up to 4 developers inside your team.
+
+The `5-9` developer seats mean you can use the license with up 9 developers.
+
+You only pay for developer seats. You can use our library with an unlimited amount of applications, environments, servers, and client machines.
+
+### I need more than 19 seats, what can I do?
+Please contact us with the number of seats required. We offer some additional discounts or enterprise licenses.
+
+Email: sales@zzzprojects.com
+
+### Is the license perpetual?
+The product comes with one year of support & upgrades but the license is perpetual (indefinitely useable). So you are not obligated to renew every year or renew at all.
+
+Renewing comes with a lot of benefits such as a 25%/35%/50% discount on purchased price, discounted or free products, etc.
+
+### Why isn't this library free and open source?
+`ZZZ Projects` mission is focused on adding value to the `.NET Community` and supporting a lot of `free and open source` libraries.
+
+However, this mission cannot be successful without being able to pay our developers for the time they pass to support & develop features for free and paid libraries.
+
+#### Free Librairies
+
+- [Html Agility Pack](http://html-agility-pack.net/){:target="_blank"}
+- [Entity Framework Plus](http://entityframework-plus.net/){:target="_blank"}
+- [Entity Framework DynamicFilter](https://github.com/zzzprojects/EntityFramework.DynamicFilters){:target="_blank"}
+- [RefactorThis.GraphDiff](https://github.com/zzzprojects/GraphDiff){:target="_blank"}
+- [Extension Methods](https://github.com/zzzprojects/Z.ExtensionMethods){:target="_blank"}
+
+#### Website
+
+- [.NET Fiddle](https://dotnetfiddle.net/){:target="_blank"}
+- [SQL Fiddle](http://sqlfiddle.com/){:target="_blank"}
+- [NuGet Must Haves](http://nugetmusthaves.com/){:target="_blank"}
+- [Dapper Tutorial](http://dapper-tutorial.net/){:target="_blank"}
+
+By contributing on paid libraries, you are also helping in keeping other libraries and website FREE.
+
+{% include section-faq-end.html %}
+
\ No newline at end of file
diff --git a/docs/pages/site/trial.md b/docs/pages/site/trial.md
new file mode 100644
index 0000000..bf98837
--- /dev/null
+++ b/docs/pages/site/trial.md
@@ -0,0 +1,20 @@
+---
+permalink: trial
+---
+
+Oops! Your trial has expired.
+
+### How can I extend my trial?
+You can extend your trial for several months by downloading the latest version at the beginning of every month.
+
+
+
+ Download
+
+
+
+### Where is the free version?
+There is no free version. All free features has been moved to a different library: Entity Framework Plus
+
+### How can I purchase a license?
+A perpetual license can be purchased from here: Buy
\ No newline at end of file
diff --git a/docs/pages/tutorials.md b/docs/pages/tutorials.md
new file mode 100644
index 0000000..d7edef2
--- /dev/null
+++ b/docs/pages/tutorials.md
@@ -0,0 +1,52 @@
+---
+permalink: tutorials
+---
+
+
+
+
+
+
+
Getting Started
+
Learn the Basics
+
+
Start using Entity Framework Extensions with our quick getting started tutorial.
diff --git a/docs/pages/tutorials/installing.md b/docs/pages/tutorials/installing.md
new file mode 100644
index 0000000..86f476e
--- /dev/null
+++ b/docs/pages/tutorials/installing.md
@@ -0,0 +1,51 @@
+---
+permalink: installing
+---
+
+**LinqToSql Plus** can be installed through NuGet.
+
+This library is **NOT FREE**
+
+The latest version always contains a trial that expires at the end of the month. You can extend your trial for several months by downloading the latest version at the begining of every month.
+
+## Step 1 - NuGet Download
+
+Go to the download page and choose the right Entity Framework version for your project.
+
+
+
+ Download
+
+
+
+## Step 2 - Done
+
+**LinqToSql Plus** doesn't require any configuration by default.
+
+All bulk operations extension methods are automatically added to your DbContext:
+- BulkInsert
+- BulkUpdate
+- BulkDelete
+- BulkMerge
+- BulkSynchronize
+
+{% include template-example.html title='Bulk Operations Examples'%}
+{% highlight csharp %}
+// Bulk Operations
+context.BulkInsert(list);
+context.BulkUpdate(list);
+context.BulkDelete(list);
+context.BulkMerge(list);
+context.BulkSynchronize(list);
+{% endhighlight %}
+
+All batch operations extension methods are automatically added to your Queryable:
+- DeleteFromQuery
+- UpdateFromQuery
+
+{% include template-example.html title='Batch Operations Examples'%}
+{% highlight csharp %}
+// Batch Operations
+context.Customers.Where(x => !x.IsActif).DeleteFromQuery();
+context.Customers.Where(x => !x.IsActif).UpdateFromQuery(x => new Customer {Actif = true});
+{% endhighlight %}
diff --git a/docs/pages/tutorials/licensing.md b/docs/pages/tutorials/licensing.md
new file mode 100644
index 0000000..e9b2967
--- /dev/null
+++ b/docs/pages/tutorials/licensing.md
@@ -0,0 +1,53 @@
+---
+permalink: licensing
+---
+
+## Evaluation Period
+- You can evaluate the library for several months before purchasing it.
+- The latest version always contains a trial that expires at the **end of the month**.
+- You can extend your trial for several months by downloading the latest version at the begining of every month.
+- If you want to use the library for personal use or educational purpose, it's possible by downloading the latest version once a month.
+
+## How can I purchase the library?
+- You can purchase the library [here](pricing)
+- Upon purchase, you will receive an email with a license name and a license key.
+- Make sure to check your **SPAM** folder if you don't receive the license within 24h.
+
+## Setup License from config file
+The license name and key can be added directly in the app.config or web.config file in the appSettings section.
+
+{% include template-example.html %}
+{% highlight csharp %}
+
+
+
+
+{% endhighlight %}
+
+## Setup License from code
+The license can be added directly in the code of your application. Make sure to follow recommendations about where to add this code.
+
+{% include template-example.html %}
+{% highlight csharp %}
+Z.LinqToSql.Plus.LinqToSqlManager.AddLicense([licenseName], [licenseKey]);
+{% endhighlight %}
+
+### Recommendations
+- **Web App:** Use Application_Start in global.asax to activate your license.
+- **WinForm App:** Use the main thread method to activate your license.
+- **Win Service:** Use the OnStart method to activate your license
+
+> Add the license before the first call to the library. Otherwise, the library will be enabled using the evaluation period.
+
+## How can I check if my license is valid?
+You can use the **ValidateLicense** method to check if the current license is valid or not.
+
+{% include template-example.html %}
+{% highlight csharp %}
+// CHECK if the license if valid for the default provider (SQL Server)
+string licenseErrorMessage;
+if (!Z.LinqToSql.Plus.LinqToSqlManager.ValidateLicense(out licenseErrorMessage))
+{
+ throw new Exception(licenseErrorMessage);
+}
+{% endhighlight %}
diff --git a/docs/pages/tutorials/overview.md b/docs/pages/tutorials/overview.md
new file mode 100644
index 0000000..33b9360
--- /dev/null
+++ b/docs/pages/tutorials/overview.md
@@ -0,0 +1,94 @@
+---
+permalink: overview
+---
+
+## Definition
+
+**LinqToSql Plus** is a library that dramatically improves LinqToSql performances by using bulk and batch operations.
+
+People using this library often report performance enhancement by 50x times and more!
+
+The library is installed through NuGet. Extension methods are added automatically to your DbContext.
+
+It easy to use, easy to customize.
+
+{% include template-example.html %}
+
+{% highlight csharp %}
+// Easy to use
+context.BulkInsert(list);
+context.BulkUpdate(list);
+context.BulkDelete(list);
+context.BulkMerge(list);
+
+// Easy to customize
+context.BulkMerge(customers, options =>
+ options.ColumnPrimaryKeyExpression = customer => customer.Code);
+{% endhighlight %}
+
+
+## Bulk Operations Methods
+
+Bulk operation methods give you additional flexibility by allowing to customize options such as primary key, columns and more.
+
+Bulk Operations Available:
+
+- [BulkInsert](/bulk-insert)
+- [BulkUpdate](/bulk-update)
+- [BulkDelete](/bulk-delete)
+- [BulkMerge](/bulk-merge) (UPSERT operation)
+- [BulkSynchronize](/bulk-synchronize)
+
+{% include template-example.html title='Bulk Operations Examples' %}
+{% highlight csharp %}
+// Easy to use
+context.BulkInsert(list);
+context.BulkUpdate(list);
+context.BulkDelete(list);
+context.BulkMerge(list);
+
+// Easy to customize
+context.BulkMerge(customers, options =>
+ options.ColumnPrimaryKeyExpression = customer => customer.Code; });
+{% endhighlight %}
+
+### Performance Comparisons
+
+| Operations | 1,000 Entities | 2,000 Entities | 5,000 Entities |
+| :-------------- | -------------: | -------------: | -------------: |
+| SaveChanges | 1,000 ms | 2,000 ms | 5,000 ms |
+| BulkInsert | 6 ms | 10 ms | 15 ms |
+| BulkUpdate | 50 ms | 55 ms | 65 ms |
+| BulkDelete | 45 ms | 50 ms | 60 ms |
+| BulkMerge | 65 ms | 80 ms | 110 ms |
+
+## Batch Operations Methods
+
+Batch Operations method allow to perform **UPDATE** or **DELETE** operation directly in the database using a LINQ Query without loading entities in the context.
+
+Everything is executed on the database side to let you get the best performance available.
+
+Batch Operations Available:
+- [DeleteFromQuery](delete-from-query)
+- [UpdateFromQuery](update-from-query)
+
+{% include template-example.html title='Batch Operations Examples' %}
+{% highlight csharp %}
+// DELETE all customers that are inactive for more than two years
+context.Customers
+ .Where(x => x.LastLogin < DateTime.Now.AddYears(-2))
+ .DeleteFromQuery();
+
+// UPDATE all customers that are inactive for more than two years
+context.Customers
+ .Where(x => x.Actif && x.LastLogin < DateTime.Now.AddYears(-2))
+ .UpdateFromQuery(x => new Customer {Actif = false});
+{% endhighlight %}
+
+### Performance Comparisons
+
+| Operations | 1,000 Entities | 2,000 Entities | 5,000 Entities |
+| :-------------- | -------------: | -------------: | -------------: |
+| SaveChanges | 1,000 ms | 2,000 ms | 5,000 ms |
+| DeleteFromQuery | 1 ms | 1 ms | 1 ms |
+| UpdateFromQuery | 1 ms | 1 ms | 1 ms |
diff --git a/docs/pages/tutorials/requirements.md b/docs/pages/tutorials/requirements.md
new file mode 100644
index 0000000..9501711
--- /dev/null
+++ b/docs/pages/tutorials/requirements.md
@@ -0,0 +1,11 @@
+---
+permalink: requirements
+---
+
+## LinqToSql
+- System.Data.Linq
+
+## Database Provider
+
+- SQL Server 2008+
+- SQL Azure
\ No newline at end of file
diff --git a/docs/pages/tutorials/tutorial-batch-operations.md b/docs/pages/tutorials/tutorial-batch-operations.md
new file mode 100644
index 0000000..b0d1240
--- /dev/null
+++ b/docs/pages/tutorials/tutorial-batch-operations.md
@@ -0,0 +1,40 @@
+---
+permalink: tutorial-batch-operations
+---
+
+## Definition
+Batch Operations method allows to perform `UPDATE` or `DELETE` operations directly in the database using a LINQ Query without loading entities in the context.
+
+Everything is executed on the database side to let you get the best performance available.
+
+Batch Operations Available:
+- [DeleteFromQuery](delete-from-query)
+- [UpdateFromQuery](update-from-query)
+
+{% include template-example.html title='Batch Operations Examples' %}
+{% highlight csharp %}
+// DELETE all customers that are inactive for more than two years
+context.Customers
+ .Where(x => x.LastLogin < DateTime.Now.AddYears(-2))
+ .DeleteFromQuery();
+
+// UPDATE all customers that are inactive for more than two years
+context.Customers
+ .Where(x => x.Actif && x.LastLogin < DateTime.Now.AddYears(-2))
+ .UpdateFromQuery(x => new Customer {Actif = false});
+{% endhighlight %}
+
+## Purpose
+Updating or deleting data with SaveChanges requires to load data first which significantly reduces application performance.
+
+It also becomes kind of weird to have to load an entity after deleting it.
+
+Batch Operations are executed directly on the database side which provides the best performance available.
+
+## Performance Comparisons
+
+| Operations | 1,000 Entities | 2,000 Entities | 5,000 Entities |
+| :-------------- | -------------: | -------------: | -------------: |
+| SaveChanges | 1,000 ms | 2,000 ms | 5,000 ms |
+| DeleteFromQuery | 1 ms | 1 ms | 1 ms |
+| UpdateFromQuery | 1 ms | 1 ms | 1 ms |
\ No newline at end of file
diff --git a/docs/pages/tutorials/tutorial-bulk-operations.md b/docs/pages/tutorials/tutorial-bulk-operations.md
new file mode 100644
index 0000000..9b9036e
--- /dev/null
+++ b/docs/pages/tutorials/tutorial-bulk-operations.md
@@ -0,0 +1,51 @@
+---
+permalink: tutorial-bulk-operations
+---
+
+## Definition
+Bulk operations method gives you additional flexibility by allowing to customize options such as primary key, columns, include childs entities and more.
+
+They are also faster than BulkSaveChanges since they don’t use the ChangeTracker and doesn’t call the DetectChanges method.
+
+Bulk Operations Available:
+- [BulkInsert](/bulk-insert)
+- [BulkUpdate](/bulk-update)
+- [BulkDelete](/bulk-delete)
+- [BulkMerge](/bulk-merge) (UPSERT operation)
+- [BulkSynchronize](/bulk-synchronize)
+
+{% include template-example.html title='Bulk Operations Examples' %}
+{% highlight csharp %}
+// Easy to use
+context.BulkInsert(list);
+context.BulkUpdate(list);
+context.BulkDelete(list);
+context.BulkMerge(list);
+
+// Easy to customize
+context.BulkMerge(customers, bulk => bulk.ColumnPrimaryKeyExpression = customer => customer.Code; });
+{% endhighlight %}
+
+## Purpose
+Using the ChangeTracker to detect and persist change automatically is great! However, almost every application has some particular scenario which requires some customization and better performance.
+
+By example:
+- Inserting thousands of hundreds of data with child entities
+- Updating only some particular fields
+- Merging a list of customers using the code instead of the key
+
+## Performance Comparisons
+
+| Operations | 1,000 Entities | 2,000 Entities | 5,000 Entities |
+| :-------------- | -------------: | -------------: | -------------: |
+| SaveChanges | 1,000 ms | 2,000 ms | 5,000 ms |
+| BulkInsert | 6 ms | 10 ms | 15 ms |
+| BulkUpdate | 50 ms | 55 ms | 65 ms |
+| BulkDelete | 45 ms | 50 ms | 60 ms |
+| BulkMerge | 65 ms | 80 ms | 110 ms |
+
+### Related Articles
+
+- [How to Benchmark?](benchmark)
+- [How to use Custom Column?](custom-column)
+- [How to use Custom Key?](custom-key)
diff --git a/docs/pages/tutorials/tutorial-bulk-savechanges.md b/docs/pages/tutorials/tutorial-bulk-savechanges.md
new file mode 100644
index 0000000..047e4db
--- /dev/null
+++ b/docs/pages/tutorials/tutorial-bulk-savechanges.md
@@ -0,0 +1,51 @@
+---
+permalink: tutorial-bulk-savechanges
+---
+
+## Definition
+
+[BulkSaveChanges](bulk-savechanges) method is the upgraded version of `SaveChanges`.
+
+All changes made in the context are persisted in the database but way faster by reducing the number of database round-trip required!
+
+BulkSaveChanges supports everything:
+
+- Association (One to One, One to Many, Many to Many, etc.)
+- Complex Type
+- Enum
+- Inheritance (TPC, TPH, TPT)
+- Navigation Property
+- Self-Hierarchy
+- Etc.
+
+{% include template-example.html title='BulkSaveChanges Examples' %}
+{% highlight csharp %}
+context.Customers.AddRange(listToAdd); // add
+context.Customers.RemoveRange(listToRemove); // remove
+listToModify.ForEach(x => x.DateModified = DateTime.Now); // modify
+
+// Easy to use
+context.BulkSaveChanges();
+
+// Easy to customize
+context.BulkSaveChanges(bulk => bulk.BatchSize = 100);
+{% endhighlight %}
+
+## Purpose
+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.
+
+`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.
+
+`BulkSaveChanges` works exactly like `SaveChanges` but reduces the number of database round-trips required to greatly help to improve the performance.
+
+## Performance Comparisons
+
+| Operations | 1,000 Entities | 2,000 Entities | 5,000 Entities |
+| :-------------- | -------------: | -------------: | -------------: |
+| SaveChanges | 1,000 ms | 2,000 ms | 5,000 ms |
+| BulkSaveChanges | 90 ms | 150 ms | 350 ms |
+
+## Related Articles
+
+- [How to Benchmark?](benchmark)
+- [How to Improve Bulk SaveChanges Performances?](improve-bulk-savechanges)
diff --git a/docs/pages/tutorials/tutorial-introduction.md b/docs/pages/tutorials/tutorial-introduction.md
new file mode 100644
index 0000000..f2cbf84
--- /dev/null
+++ b/docs/pages/tutorials/tutorial-introduction.md
@@ -0,0 +1,107 @@
+---
+permalink: tutorial-introduction
+---
+
+## Introduction
+Entity Framework Extensions allow you to improve dramatically your save operations performance.
+
+It's easy to use, and easy to customize.
+
+## Bulk SaveChanges
+The BulkSaveChanges works like SaveChanges but way faster.
+
+BulkSaveChanges use Bulk Operations to save all entities in the Change Tracker efficiently instead of performing a database round-trip for every entity like SaveChanges does.
+
+BulkSaveChanges support everything:
+
+- Complex Types
+- Inheritance (TPC, TPH, TPT)
+- Relationship (One to One, One to Many, Many to Many)
+
+### Example
+{% include template-example.html %}
+{% highlight csharp %}
+var ctx = new EntitiesContext();
+
+ctx.Customers.AddRange(listToAdd); // add
+ctx.Customers.RemoveRange(listToRemove); // remove
+listToModify.ForEach(x => x.DateModified = DateTime.Now); // modify
+
+// Easy to use
+ctx.BulkSaveChanges();
+
+// Easy to customize
+context.BulkSaveChanges(bulk => bulk.BatchSize = 100);
+{% endhighlight %}
+### Performance Comparisons
+
+| Operations | 1,000 Entities | 2,000 Entities | 5,000 Entities |
+| :-------------- | -------------: | -------------: | -------------: |
+| SaveChanges | 1,000 ms | 2,000 ms | 5,000 ms |
+| BulkSaveChanges | 90 ms | 150 ms | 350 ms |
+
+## Bulk Operations
+
+Bulk Operations method provide you some flexibility by allowing some customization and performance enhancement.
+
+All common methods are supported:
+
+- BulkInsert
+- BulkUpdate
+- BulkDelete
+- BulkMerge (UPSERT operation)
+- BulkSynchronize
+
+### Example
+
+{% include template-example.html %}
+{% highlight csharp %}
+var ctx = new EntitiesContext();
+
+// Easy to use
+ctx.BulkInsert(list);
+ctx.BulkUpdate(list);
+ctx.BulkDelete(list);
+ctx.BulkMerge(list);
+
+// Easy to customize
+context.BulkMerge(customers,
+ bulk => bulk.ColumnPrimaryKeyExpression = customer => customer.Code; });
+{% endhighlight %}
+
+### Performance Comparisons
+
+| Operations | 1,000 Entities | 2,000 Entities | 5,000 Entities |
+| :-------------- | -------------: | -------------: | -------------: |
+| SaveChanges | 1,000 ms | 2,000 ms | 5,000 ms |
+| BulkInsert | 6 ms | 10 ms | 15 ms |
+| BulkUpdate | 50 ms | 55 ms | 65 ms |
+| BulkDelete | 45 ms | 50 ms | 60 ms |
+| BulkMerge | 65 ms | 80 ms | 110 ms |
+
+## FromQuery Operations
+
+FromQuery method allows you to execute UPDATE or DELETE statements without loading entities in the context.
+
+### Example
+
+{% include template-example.html %}
+{% highlight csharp %}
+// DELETE all customers that are inactive for more than two years
+context.Customers
+ .Where(x => x.LastLogin < DateTime.Now.AddYears(-2))
+ .DeleteFromQuery();
+
+// UPDATE all customers that are inactive for more than two years
+context.Customers
+ .Where(x => x.Actif && x.LastLogin < DateTime.Now.AddYears(-2))
+ .UpdateFromQuery(x => new Customer {Actif = false});
+{% endhighlight %}
+
+### Performance Comparisons
+
+| Operations | 1,000 Entities | 2,000 Entities | 5,000 Entities |
+| :-------------- | -------------: | -------------: | -------------: |
+| SaveChanges | 1,000 ms | 2,000 ms | 5,000 ms |
+| DeleteFromQuery | 1 ms | 1 ms | 1 ms |
+| UpdateFromQuery | 1 ms | 1 ms | 1 ms |
diff --git a/docs/pages/tutorials/upgrading.md b/docs/pages/tutorials/upgrading.md
new file mode 100644
index 0000000..9edac1c
--- /dev/null
+++ b/docs/pages/tutorials/upgrading.md
@@ -0,0 +1,15 @@
+---
+permalink: upgrading
+---
+
+## Step 1 - Before Upgrading
+Before upgrading:
+- Make sure to read [release notes](https://github.com/zzzprojects/LinqToSql-Plus/releases)
+
+## Step 2 - NuGet Download
+
+
+
+ Download
+
+
\ No newline at end of file
diff --git a/docs/robots.txt b/docs/robots.txt
new file mode 100644
index 0000000..f968e0d
--- /dev/null
+++ b/docs/robots.txt
@@ -0,0 +1,6 @@
+# www.robotstxt.org/
+
+# Allow crawling of all content
+User-agent: *
+Disallow:
+Sitemap: http://entityframework-extensions.net/sitemap.xml