Skip to content

Commit 5a57b8a

Browse files
Merge pull request #41 from Lempireqc/master
save
2 parents 0113299 + 76b08a2 commit 5a57b8a

16 files changed

+159
-157
lines changed

Diff for: docs/pages/features/also-include.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ctx.OrderDetails
1313
.ToList();
1414
```
1515

16-
[Try it](https://dotnetfiddle.net/tuONVZ)
16+
Try it: [NET Framework](https://dotnetfiddle.net/tuONVZ) | [NET Core](https://dotnetfiddle.net/LhSCEh)
1717

1818
### Note
1919
- If you want to reset the level to the root, use [`Include`](include.md)
@@ -35,4 +35,4 @@ ctx.OrderDetails
3535
.ToList();
3636
```
3737

38-
[Try it](https://dotnetfiddle.net/33OIDZ)
38+
Try it: [NET Framework](https://dotnetfiddle.net/33OIDZ) | [NET Core](https://dotnetfiddle.net/Btyl3G)

Diff for: docs/pages/features/attach.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ To improve the flexibility, we added an over that let you attach an entity by sp
1212
```csharp
1313
context.Customers.Attach(customer, EntityState.Deleted);
1414
```
15-
[Try it](https://dotnetfiddle.net/oGrm5U)
15+
Try it: [NET Framework](https://dotnetfiddle.net/oGrm5U) | [NET Core](https://dotnetfiddle.net/gh4uQZ)
1616

1717
## AttachRange
1818

@@ -22,4 +22,4 @@ context.Customers.Attach(customer, EntityState.Deleted);
2222
context.Customers.AttachRange(customers, EntityState.Deleted);
2323
```
2424

25-
[Try it](https://dotnetfiddle.net/jmIlp1)
25+
Try it: [NET Framework](https://dotnetfiddle.net/jmIlp1) | [NET Core](https://dotnetfiddle.net/H1KSi7)

Diff for: docs/pages/features/audit.md

+95-95
Large diffs are not rendered by default.

Diff for: docs/pages/features/batch-save-changes.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The **Batch SaveChanges** feature allows you to reduce the number of database ro
77
// context.SaveChanges();
88
context.BatchSaveChanges();
99
```
10-
[Try it](https://dotnetfiddle.net/dJK5Vr)
10+
Try it: [NET Framework](https://dotnetfiddle.net/dJK5Vr) | [NET Core](https://dotnetfiddle.net/nRotN4)
1111

1212
> HINT: We recommend to always use `BatchSaveChanges` over `SaveChanges` or enable the option `UseBatchForSaveChanges`.
1313
@@ -18,6 +18,8 @@ context.BatchSaveChanges();
1818
| SaveChanges | 1,200 ms | 2,400 ms | 6,000 ms |
1919
| BatchSaveChanges| 100 ms | 200 ms | 500 ms |
2020

21+
Try it: [NET Framework](https://dotnetfiddle.net/2MDZQh) | [NET Core](https://dotnetfiddle.net/ouVK6Z)
22+
2123
> HINT: Performance may differ from a database to another. A lot of factors might affect the benchmark time such as index, column type, latency, throttling, etc.
2224
2325
### Why BatchSaveChanges is faster than SaveChanges?
@@ -34,7 +36,7 @@ So if you have 10 rows to insert:
3436
// context.SaveChanges();
3537
context.BatchSaveChanges();
3638
```
37-
[Try it](https://dotnetfiddle.net/PQHDLC)
39+
Try it: [NET Framework](https://dotnetfiddle.net/PQHDLC) | [NET Core](https://dotnetfiddle.net/CFZhU9)
3840

3941
### Internally replace SaveChanges by BatchSaveChanges
4042
```csharp
@@ -51,16 +53,16 @@ public class EntityContext : DbContext
5153
context.Customers.AddRange(customers);
5254
context.SaveChanges();
5355
```
54-
[Try it](https://dotnetfiddle.net/SQ58gU)
56+
Try it: [NET Framework](https://dotnetfiddle.net/SQ58gU) | [NET Core](https://dotnetfiddle.net/ciy7du)
5557

5658
## Documentation
5759

5860
###### Properties
5961

6062
| Name | Description | Default | Example |
6163
| :--- | :---------- | :-----: | :------ |
62-
| `IsEnabled` | Gets or sets if the `BatchSaveChanges` feature is enabled. When disabled, a `SaveChanges` will be performed instead. | `true` | [Try it](https://dotnetfiddle.net/jo6QN1) |
63-
| `UseBatchForSaveChanges` | Gets or sets if all `SaveChanges` call should be replaced internally by `BatchSaveChanges`. If you own a commercial license, we recommend to always set this value to true. | `false` | [Try it](https://dotnetfiddle.net/ceeM0J) |
64+
| `IsEnabled` | Gets or sets if the `BatchSaveChanges` feature is enabled. When disabled, a `SaveChanges` will be performed instead. | `true` | [NET Framework](https://dotnetfiddle.net/jo6QN1) / [NET Core](https://dotnetfiddle.net/NqAJ1Q) |
65+
| `UseBatchForSaveChanges` | Gets or sets if all `SaveChanges` call should be replaced internally by `BatchSaveChanges`. If you own a commercial license, we recommend to always set this value to true. | `false` | [NET Framework](https://dotnetfiddle.net/ceeM0J) / [NET Core](https://dotnetfiddle.net/F4NEpM) |
6466

6567
## Limitations
6668
- All providers that don't support multi statements such as SQL Compact and Effort will automatically use `SaveChanges` instead.

Diff for: docs/pages/features/bulk-delete.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ context.BulkDelete(customers);
1212
// Easy to customize
1313
context.BulkDelete(customers, options => options.ColumnPrimaryKeyExpression = customer => customer.Code);
1414
```
15-
[Try it](https://dotnetfiddle.net/vnq5Dw)
15+
Try it: [NET Framework](https://dotnetfiddle.net/vnq5Dw) | [NET Core](https://dotnetfiddle.net/UP8x9D)
1616

1717
## Performance Comparison
1818

@@ -21,7 +21,7 @@ context.BulkDelete(customers, options => options.ColumnPrimaryKeyExpression = cu
2121
| SaveChanges | 1,200 ms | 2,400 ms | 6,000 ms |
2222
| BulkDelete | 50 ms | 55 ms | 75 ms |
2323

24-
[Try it](https://dotnetfiddle.net/BnBmqF)
24+
Try it: [NET Framework](https://dotnetfiddle.net/BnBmqF) | [NET Core](https://dotnetfiddle.net/cKxsEq)
2525

2626
> HINT: Performance may differ from a database to another. A lot of factors might affect the benchmark time such as index, column type, latency, throttling, etc.
2727
@@ -40,7 +40,7 @@ You need to delete a list of `Customer` but you dont have the IDs, you only have
4040
```csharp
4141
context.BulkDelete(customers, options => options.ColumnPrimaryKeyExpression = customer => customer.Code);
4242
```
43-
[Try it](https://dotnetfiddle.net/cGvtjF)
43+
Try it: [NET Framework](https://dotnetfiddle.net/cGvtjF) | [NET Core](https://dotnetfiddle.net/3uvfUv)
4444

4545
## Learn more
4646

Diff for: docs/pages/features/bulk-insert.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ context.BulkInsert(list);
1212
// Easy to customize
1313
context.BulkInsert(list, options => options.BatchSize = 100);
1414
```
15-
[Try it](https://dotnetfiddle.net/7PnUvq)
15+
Try it: [NET Framework](https://dotnetfiddle.net/7PnUvq) | [NET Core](https://dotnetfiddle.net/Ws2dgA)
1616

1717
## Performance Comparison
1818

@@ -21,7 +21,7 @@ context.BulkInsert(list, options => options.BatchSize = 100);
2121
| SaveChanges | 1,200 ms | 2,400 ms | 6,000 ms |
2222
| BulkInsert | 50 ms | 55 ms | 75 ms |
2323

24-
[Try it](https://dotnetfiddle.net/hfbiys)
24+
Try it: [NET Framework](https://dotnetfiddle.net/hfbiys) | [NET Core](https://dotnetfiddle.net/KHmNWf)
2525

2626
> HINT: Performance may differ from a database to another. A lot of factors might affect the benchmark time such as index, column type, latency, throttling, etc.
2727
@@ -40,7 +40,7 @@ You need to insert a list of `Invoice` and include related `InvoiceItem`. By def
4040
```csharp
4141
context.BulkInsert(invoices, options => options.IncludeGraph = true);
4242
```
43-
[Try it](https://dotnetfiddle.net/DGkPHC)
43+
Try it: [NET Framework](https://dotnetfiddle.net/DGkPHC) | [NET Core](https://dotnetfiddle.net/mlFNqB)
4444

4545
### Bulk Insert customers that don't already exist
4646
You need to insert a list of `Customer`, but only the ones that doesn't already exists using the customer codes as the key.
@@ -54,7 +54,7 @@ context.BulkInsert(customers, options => {
5454
options.ColumnPrimaryKeyExpression = x => new { x.Code };
5555
});
5656
```
57-
[Try it](https://dotnetfiddle.net/CtwBQw)
57+
Try it: [NET Framework](https://dotnetfiddle.net/CtwBQw) | [NET Core](https://dotnetfiddle.net/THtLSm)
5858

5959
### Bulk Insert specific columns
6060
You need to insert a list of `Customer` but only insert some specific column. The [ColumnInputExpression](https://entityframework-extensions.net/column#column-input) option let you choose a column to insert.
@@ -64,7 +64,7 @@ context.BulkInsert(customers, options => {
6464
options.ColumnInputExpression = x => new { x.Code, x.CreatedDate };
6565
});
6666
```
67-
[Try it](https://dotnetfiddle.net/x5qTfp)
67+
Try it: [NET Framework](https://dotnetfiddle.net/x5qTfp) | [NET Core](https://dotnetfiddle.net/XBpAvg)
6868

6969
## Learn more
7070

Diff for: docs/pages/features/bulk-merge.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ context.BulkMerge(customers);
1212
// Easy to customize
1313
context.BulkMerge(customers, options => options.ColumnPrimaryKeyExpression = customer => customer.Code);
1414
```
15-
[Try it](https://dotnetfiddle.net/HxfhEn)
15+
Try it: [NET Framework](https://dotnetfiddle.net/HxfhEn) | [NET Core](https://dotnetfiddle.net/9Z8Cr9)
1616

1717
## Performance Comparison
1818

@@ -21,7 +21,7 @@ context.BulkMerge(customers, options => options.ColumnPrimaryKeyExpression = cus
2121
| SaveChanges | 4,000 ms | To long... | Way way to long... |
2222
| BulkMerge | 80 ms | 110 ms | 170 ms |
2323

24-
[Try it](https://dotnetfiddle.net/L1yqaL)
24+
Try it: [NET Framework](https://dotnetfiddle.net/L1yqaL) | [NET Core](https://dotnetfiddle.net/3d1KUv)
2525

2626
> HINT: Performance may differ from a database to another. A lot of factors might affect the benchmark time such as index, column type, latency, throttling, etc.
2727
@@ -44,7 +44,7 @@ You need to update a list of `Customer` but you dont have the IDs, you only have
4444
```csharp
4545
context.BulkMerge(customers, options => options.ColumnPrimaryKeyExpression = customer => customer.Code);
4646
```
47-
[Try it](https://dotnetfiddle.net/xItcSY)
47+
Try it: [NET Framework](https://dotnetfiddle.net/xItcSY) | [NET Core](https://dotnetfiddle.net/XJLfKe)
4848

4949
## Bulk Merge specific columns
5050
You need to update a list of `Customer` but only update some specific columns such as FirstName and LastName. The [ColumnInputExpression](https://entityframework-extensions.net/column#column-input) option let you to choose columns to update.
@@ -55,7 +55,7 @@ context.BulkMerge(customers, options => {
5555
options.ColumnPrimaryKeyExpression = customer => customer.Code;
5656
});
5757
```
58-
[Try it](https://dotnetfiddle.net/0eArw7)
58+
Try it: [NET Framework](https://dotnetfiddle.net/0eArw7) | [NET Core](https://dotnetfiddle.net/ServiU)
5959

6060
## Bulk Merge specific columns on Update or Insert
6161
You need to update a list of `Customer` but only save the `CreatedDate` on insert and save the `ModifiedDate` on update.
@@ -68,15 +68,15 @@ context.BulkMerge(customers, options => {
6868
options.IgnoreOnMergeUpdateExpression = customer => customer.CreatedDate;
6969
});
7070
```
71-
[Try it](https://dotnetfiddle.net/mycIU1)
71+
Try it: [NET Framework](https://dotnetfiddle.net/mycIU1) | [NET Core](https://dotnetfiddle.net/dDKgsR)
7272

7373
## Bulk Merge invoice and related invoice items (Include Graph)
7474
You need to update a list of `Invoice` and include related `InvoiceItem`. By default, the `BulkUpdate` doesn't include the graph but you can enable it with the [IncludeGraph](https://entityframework-extensions.net/include-graph) option.
7575

7676
```csharp
7777
context.BulkMerge(invoices, options => options.IncludeGraph = true);
7878
```
79-
[Try it](https://dotnetfiddle.net/owLagp)
79+
Try it: [NET Framework](https://dotnetfiddle.net/owLagp) | [NET Core](https://dotnetfiddle.net/hQfCEO)
8080

8181
## Learn more
8282

Diff for: docs/pages/features/bulk-save-changes.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ context.BulkSaveChanges();
1616
// Easy to customize
1717
context.BulkSaveChanges(bulk => bulk.BatchSize = 100);
1818
```
19-
[Try it](https://dotnetfiddle.net/1JFvZe)
19+
Try it: [NET Framework](https://dotnetfiddle.net/1JFvZe) | [NET Core](https://dotnetfiddle.net/8Rc5Eg)
2020

2121
## Performance Comparison
2222

@@ -26,7 +26,7 @@ context.BulkSaveChanges(bulk => bulk.BatchSize = 100);
2626
| BulkSaveChanges | 175 ms | 325 ms | 750 ms |
2727
| BulkSaveChanges(false) | 125 ms | 200 ms | 450 ms |
2828

29-
[Try it](https://dotnetfiddle.net/Ad1bmZ)
29+
Try it: [NET Framework](https://dotnetfiddle.net/Ad1bmZ) | [NET Core](https://dotnetfiddle.net/cIGiKE)
3030

3131
> HINT: Performance may differ from a database to another. A lot of factors might affect the benchmark time such as index, column type, latency, throttling, etc.
3232

Diff for: docs/pages/features/bulk-synchronize.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ctx.BulkSynchronize(list);
1717
context.BulkSynchronize(customers, options => options.ColumnPrimaryKeyExpression = customer => customer.Code);
1818
```
1919

20-
[Try it](https://dotnetfiddle.net/4KVPJn)
20+
Try it: [NET Framework](https://dotnetfiddle.net/4KVPJn) | [NET Core](https://dotnetfiddle.net/PMxuNO)
2121

2222
## Learn more
2323

Diff for: docs/pages/features/bulk-update.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ context.BulkUpdate(customers);
1212
// Easy to customize
1313
context.BulkUpdate(customers, options => options.ColumnPrimaryKeyExpression = customer => customer.Code);
1414
```
15-
[Try it](https://dotnetfiddle.net/WYxuyf)
15+
Try it: [NET Framework](https://dotnetfiddle.net/WYxuyf) | [NET Core](https://dotnetfiddle.net/EIjAFh)
1616

1717
## Performance Comparison
1818

@@ -21,7 +21,7 @@ context.BulkUpdate(customers, options => options.ColumnPrimaryKeyExpression = cu
2121
| SaveChanges | 1,200 ms | 2,400 ms | 6,000 ms |
2222
| BulkUpdate | 80 ms | 110 ms | 170 ms |
2323

24-
[Try it](https://dotnetfiddle.net/RAuYhO)
24+
Try it: [NET Framework](https://dotnetfiddle.net/RAuYhO) | [NET Core](https://dotnetfiddle.net/8BnXFR)
2525

2626
> HINT: Performance may differ from a database to another. A lot of factors might affect the benchmark time such as index, column type, latency, throttling, etc.
2727
@@ -40,7 +40,7 @@ You need to update a list of `Customer` but you dont have the IDs, you only have
4040
```csharp
4141
context.BulkUpdate(customers, options => options.ColumnPrimaryKeyExpression = customer => customer.Code);
4242
```
43-
[Try it](https://dotnetfiddle.net/dMGZcV)
43+
Try it: [NET Framework](https://dotnetfiddle.net/dMGZcV) | [NET Core](https://dotnetfiddle.net/8ZuEW4)
4444

4545
## Bulk Update specific columns
4646
You need to update a list of `Customer` but only update some specific columns such as FirstName and LastName. The [ColumnInputExpression](https://entityframework-extensions.net/column#column-input) option let you choose the columns to update.
@@ -51,15 +51,15 @@ context.BulkUpdate(customers, options => {
5151
options.ColumnPrimaryKeyExpression = customer => customer.Code;
5252
});
5353
```
54-
[Try it](https://dotnetfiddle.net/WBgGqx)
54+
Try it: [NET Framework](https://dotnetfiddle.net/WBgGqx) | [NET Core](https://dotnetfiddle.net/zUu8m8)
5555

5656
## Bulk Update invoice and related invoice items (Include Graph)
5757
You need to update a list of `Invoice` and include related `InvoiceItem`. By default, the `BulkUpdate` doesn't include the graph but you can enable it with the [IncludeGraph](https://entityframework-extensions.net/include-graph) option.
5858

5959
```csharp
6060
context.BulkUpdate(invoices, options => options.IncludeGraph = true);
6161
```
62-
[Try it](https://dotnetfiddle.net/ljXay5)
62+
Try it: [NET Framework](https://dotnetfiddle.net/ljXay5) | [NET Core](https://dotnetfiddle.net/ovvcp5)
6363

6464
## Learn more
6565

Diff for: docs/pages/features/csharp-eval-expression.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The **C# Eval Expression** features let you execute code dynamically.
66
```csharp
77
var result = Eval.Execute("X + Y", new { X = 1, Y = 2 }); // return 3
88
```
9-
[Try it](https://dotnetfiddle.net/W9TwcP)
9+
Try it: [NET Framework](https://dotnetfiddle.net/W9TwcP) | [NET Core](https://dotnetfiddle.net/SCrswb)
1010

1111
This feature is provided by the library [C# Eval Epression](https://eval-expression.net/) _(Included with EF Classic)_.
1212

@@ -49,7 +49,7 @@ foreach(var item in list)
4949
}
5050
}
5151
```
52-
[Try it](https://dotnetfiddle.net/2sAvrj)
52+
Try it: [NET Framework](https://dotnetfiddle.net/2sAvrj) | [NET Core](https://dotnetfiddle.net/xPjYVr)
5353

5454
### Executing LINQ from json
5555
Your application need to filter returning entities depending on the json you receive.
@@ -90,7 +90,7 @@ foreach(var qc in queryCriterias)
9090
}
9191
}
9292
```
93-
[Try it](https://dotnetfiddle.net/UptHy0)
93+
Try it: [NET Framework](https://dotnetfiddle.net/UptHy0) | [NET Core](https://dotnetfiddle.net/5dp1qY)
9494

9595
## Learn more
9696

Diff for: docs/pages/features/csharp-eval-function.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The **C# Eval Expression** features let you execute code dynamically.
66
```csharp
77
var result = Eval.Execute("X + Y", new { X = 1, Y = 2 }); // return 3
88
```
9-
[Try it](https://dotnetfiddle.net/W9TwcP)
9+
Try it: [NET Framework](https://dotnetfiddle.net/W9TwcP) | [NET Core](https://dotnetfiddle.net/9cFh2u)
1010

1111
This feature is provided by the library [C# Eval Epression](https://eval-expression.net/) _(Included with EF Classic)_.
1212

@@ -49,7 +49,7 @@ foreach(var item in list)
4949
}
5050
}
5151
```
52-
[Try it](https://dotnetfiddle.net/2sAvrj)
52+
Try it: [NET Framework](https://dotnetfiddle.net/2sAvrj) | [NET Core](https://dotnetfiddle.net/LHqZ3a)
5353

5454
### Executing LINQ from json
5555
Your application need to filter returning entities depending on the json you receive.
@@ -90,7 +90,7 @@ foreach(var qc in queryCriterias)
9090
}
9191
}
9292
```
93-
[Try it](https://dotnetfiddle.net/UptHy0)
93+
Try it: [NET Framework](https://dotnetfiddle.net/UptHy0) | [NET Core](https://dotnetfiddle.net/kyBknY)
9494

9595
## Learn more
9696

Diff for: docs/pages/features/delete-from-query.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ context.Customers.Where(x => !x.IsActive).DeleteFromQuery();
1515
context.Customers.Where(x => x.ID == userId).DeleteFromQuery();
1616
```
1717

18-
[Try it](https://dotnetfiddle.net/msiYwA)
18+
Try it: [NET Framework](https://dotnetfiddle.net/msiYwA) | [NET Core](https://dotnetfiddle.net/9ZlWiG)
1919

2020
## Purpose
2121
`Deleting` entities using `SaveChanges` normally requires to load them first in the `ChangeTracker`. These additional round-trips are often not necessary.

Diff for: docs/pages/features/include.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ctx.Customers
1414
.AlsoInclude(product => product.Supplier)
1515
.ToList();
1616
```
17-
[Try it](https://dotnetfiddle.net/MkpoSo)
17+
Try it: [NET Framework](https://dotnetfiddle.net/MkpoSo) | [NET Core](https://dotnetfiddle.net/dyWV1T)
1818

1919
### Note
2020
- If you want to include items from the same level, use [`AlsoInclude`](also-include.md)
@@ -35,7 +35,7 @@ ctx.OrderDetails
3535
.AlsoInclude(product => product.Supplier)
3636
.ToList();
3737
```
38-
[Try it](https://dotnetfiddle.net/2XJrc5)
38+
Try it: [NET Framework](https://dotnetfiddle.net/2XJrc5) | [NET Core](https://dotnetfiddle.net/5g8jcN)
3939

4040
> It's planned to remove this limitation.
4141

0 commit comments

Comments
 (0)