Skip to content

Commit

Permalink
Update bulk-merge.md
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanMagnan authored Apr 5, 2019
1 parent b8e65ba commit bf84175
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs2/pages/documentations/bulk-merge.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ bulk.DestinationTableName = "InvoiceItems";
bulk.BulkMerge(invoices.SelectMany(x => x.Items).ToList());
```
[Try it (Entity)](https://dotnetfiddle.net/qpe8bV)

[Try it (DataTable)](https://dotnetfiddle.net/rgugIj)

### Performance Comparison
Expand All @@ -35,6 +36,7 @@ bulk.BulkMerge(invoices.SelectMany(x => x.Items).ToList());
| BulkMerge | 80 ms | 110 ms | 170 ms |

[Try this benchmark online (Entity)](https://dotnetfiddle.net/roGRsu)

[Try this benchmark online (DataTable)](https://dotnetfiddle.net/CY5s3G)

> HINT: A lot of factors might affect the benchmark time such as index, column type, latency, throttling, etc.
Expand Down Expand Up @@ -65,6 +67,7 @@ bulk.BulkMerge(customers);
bulk.BulkMergeAsync(customers, cancellationToken);
```
[Try it (Entity)](https://dotnetfiddle.net/pigFx8)

[Try it (DataTable)](https://dotnetfiddle.net/LULDpj)

### Bulk Merge with options
Expand All @@ -75,6 +78,7 @@ bulk.ColumnPrimaryKeyExpression = c => c.Code;
bulk.BulkMerge(customers);
```
[Try it (Entity)](https://dotnetfiddle.net/5wMQ6X)

[Try it (DataTable)](https://dotnetfiddle.net/JJIPCB)

## Real Life Scenarios
Expand All @@ -87,6 +91,7 @@ bulk.MergeKeepIdentity = true;
bulk.BulkMerge(customers);
```
[Try it (Entity)](https://dotnetfiddle.net/52uijH)

[Try it (DataTable)](https://dotnetfiddle.net/gNXl1z)

### Merge and include/exclude properties
Expand Down Expand Up @@ -114,6 +119,7 @@ bulk.ColumnPrimaryKeyExpression = c => c.Code
bulk.BulkMerge(customers);
```
[Try it (Entity)](https://dotnetfiddle.net/Xlcdxq)

[Try it (DataTable)](https://dotnetfiddle.net/9KOxdW)

### Merge with related child entities
Expand All @@ -133,6 +139,7 @@ invoices.ForEach(x => x.Items.ForEach(y => y.InvoiceID = x.InvoiceID));
bulk.BulkMerge(invoices);
```
[Try it (Entity)](https://dotnetfiddle.net/rhq5ZM)

[Try it (DataTable)](https://dotnetfiddle.net/rhq5ZM)

### More scenarios
Expand Down

0 comments on commit bf84175

Please sign in to comment.