Skip to content

Commit 7eafff9

Browse files
Merge pull request #42 from Lempireqc/master
save
2 parents 5a57b8a + a05ffdb commit 7eafff9

12 files changed

+102
-102
lines changed

docs/pages/features/net-fiddle.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class EntityContext : DbContext
1818
}
1919
```
2020

21-
[Try it](https://dotnetfiddle.net/thNOFY)
21+
Try it: [NET Framework](https://dotnetfiddle.net/thNOFY) | [NET Core](https://dotnetfiddle.net/t9KHwk)
2222

2323
## SQL Server Compact Example
2424
```csharp

docs/pages/features/query-cache.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var countries1 = context.Countries.Cache().ToList();
2020
var countries2 = context.Countries.Cache().ToList();
2121
```
2222

23-
[Try it](https://dotnetfiddle.net/lXIiex)
23+
Try it: [NET Framework](https://dotnetfiddle.net/lXIiex) | [NET Core](https://dotnetfiddle.net/7BX0pc)
2424

2525
## Query Cache Async
2626

@@ -56,7 +56,7 @@ var count = context.Countries.DeferredCount().Cache();
5656

5757
Console.WriteLine("Countries Count: " + count);
5858
```
59-
[Try it](https://dotnetfiddle.net/ouZ2wI)
59+
Try it: [NET Framework](https://dotnetfiddle.net/ouZ2wI) | [NET Core](https://dotnetfiddle.net/3n1pRZ)
6060

6161
Query Deferred supports all Queryable extension methods and overloads.
6262

@@ -77,7 +77,7 @@ Console.WriteLine("Countries Count: " + count);
7777
// Expire all cache entries using the "countries" tag
7878
QueryCacheManager.ExpireTag("countries");
7979
```
80-
[Try it](https://dotnetfiddle.net/bCEdyg)
80+
Try it: [NET Framework](https://dotnetfiddle.net/bCEdyg) | [NET Core](https://dotnetfiddle.net/H44EaR)
8181

8282
## Query Cache Expiration
8383

@@ -90,7 +90,7 @@ var options = new CacheItemPolicy() { SlidingExpiration = TimeSpan.FromHours(2)}
9090
var countries = context.Countries.Cache(options).ToList();
9191
FiddleHelper.WriteTable(countries);
9292
```
93-
[Try it](https://dotnetfiddle.net/i2VOeg)
93+
Try it: [NET Framework](https://dotnetfiddle.net/i2VOeg) | [NET Core](https://dotnetfiddle.net/D4d0pv)
9494

9595
## Query Cache Control
9696

@@ -109,7 +109,7 @@ You can set default policy
109109
// The query is cached for 2 hours of inactivity
110110
QueryCacheManager.CacheItemPolicyFactory = () => new CacheItemPolicy() { SlidingExpiration = TimeSpan.FromHours(2) };
111111
```
112-
[Try it](https://dotnetfiddle.net/rKmdXl)
112+
Try it: [NET Framework](https://dotnetfiddle.net/rKmdXl) | [NET Core](https://dotnetfiddle.net/x3hVfR)
113113

114114
## Redis Cache (Beta)
115115
This feature is currently in beta, you can try it but be aware that some code such as parameter order might change when it is officially released.

docs/pages/features/query-deferred.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ However, some features like **Query Cache** and **Query Future** cannot be used
1515

1616
| Name | Description | Example |
1717
| :--- | :---------- | :------ |
18-
| `DeferredAll` | QueryDeferred extension method. Determines whether all elements of a sequence satisfy a condition. | [Try it](https://dotnetfiddle.net/R4nKJc) |
19-
| `DeferredAny` | QueryDeferred extension method. Determines whether a sequence contains any elements. | [Try it](https://dotnetfiddle.net/Nnv3fB) |
20-
| `DeferredAverage` | QueryDeferred extension method. Computes the average of a sequence of Single values. | [Try it](https://dotnetfiddle.net/KUPPPf) |
21-
| `DeferredCount` | QueryDeferred extension method. Returns the number of elements in a sequence. | [Try it](https://dotnetfiddle.net/GAEt8F) |
22-
| `DeferredFirst` | QueryDeferred extension method. Returns the first element of a sequence. | [Try it](https://dotnetfiddle.net/VNtEF2) |
23-
| `DeferredFirstOrDefault` | QueryDeferred extension method. Returns the first element of a sequence, or a default value if the sequence contains no elements. | [Try it](https://dotnetfiddle.net/MEM6Ub) |
24-
| `DeferredLongCount` | QueryDeferred extension method. Returns an Int64 that represents how many elements in a sequence satisfy a condition. | [Try it](https://dotnetfiddle.net/0wPWSF) |
25-
| `DeferredMax` | QueryDeferred extension method. Returns the maximum value in a sequence | [Try it](https://dotnetfiddle.net/9GljhW) |
26-
| `DeferredMin` | QueryDeferred extension method. Returns the minimum value in a sequence | [Try it](https://dotnetfiddle.net/8h3Fjt) |
27-
| `DeferredSingle` | QueryDeferred extension method. Returns the minimum value in a sequence of Single values. | [Try it](https://dotnetfiddle.net/YmhLeU) |
28-
| `DeferredSingleOrDefault` | QueryDeferred extension method. Returns the minimum value in a sequence of nullable Single values. | [Try it](https://dotnetfiddle.net/8k6V4Q) |
29-
| `DeferredSum` | QueryDeferred extension method. Computes the sum of a sequence | [Try it](https://dotnetfiddle.net/ugoMmG) |
18+
| `DeferredAll` | QueryDeferred extension method. Determines whether all elements of a sequence satisfy a condition. | [NET Framework](https://dotnetfiddle.net/R4nKJc) / [NET Core](https://dotnetfiddle.net/rXloUh) |
19+
| `DeferredAny` | QueryDeferred extension method. Determines whether a sequence contains any elements. | [NET Framework](https://dotnetfiddle.net/Nnv3fB) / [NET Core](https://dotnetfiddle.net/A2Q5Yi) |
20+
| `DeferredAverage` | QueryDeferred extension method. Computes the average of a sequence of Single values. | [NET Framework](https://dotnetfiddle.net/KUPPPf) / [NET Core](https://dotnetfiddle.net/uOU29N) |
21+
| `DeferredCount` | QueryDeferred extension method. Returns the number of elements in a sequence. | [NET Framework](https://dotnetfiddle.net/GAEt8F) / [NET Core](https://dotnetfiddle.net/Vj5Zjo) |
22+
| `DeferredFirst` | QueryDeferred extension method. Returns the first element of a sequence. | [NET Framework](https://dotnetfiddle.net/VNtEF2) / [NET Core](https://dotnetfiddle.net/crZUfE) |
23+
| `DeferredFirstOrDefault` | QueryDeferred extension method. Returns the first element of a sequence, or a default value if the sequence contains no elements. | [NET Framework](https://dotnetfiddle.net/MEM6Ub) / [NET Core](https://dotnetfiddle.net/IAurZU) |
24+
| `DeferredLongCount` | QueryDeferred extension method. Returns an Int64 that represents how many elements in a sequence satisfy a condition. | [NET Framework](https://dotnetfiddle.net/0wPWSF) / [NET Core](https://dotnetfiddle.net/3zjKYj) |
25+
| `DeferredMax` | QueryDeferred extension method. Returns the maximum value in a sequence | [NET Framework](https://dotnetfiddle.net/9GljhW) / [NET Core](https://dotnetfiddle.net/rF8RDF) |
26+
| `DeferredMin` | QueryDeferred extension method. Returns the minimum value in a sequence | [NET Framework](https://dotnetfiddle.net/8h3Fjt) / [NET Core](https://dotnetfiddle.net/IskFgT) |
27+
| `DeferredSingle` | QueryDeferred extension method. Returns the minimum value in a sequence of Single values. | [NET Framework](https://dotnetfiddle.net/YmhLeU) / [NET Core](https://dotnetfiddle.net/sPXcC1) |
28+
| `DeferredSingleOrDefault` | QueryDeferred extension method. Returns the minimum value in a sequence of nullable Single values. | [NET Framework](https://dotnetfiddle.net/8k6V4Q) / [NET Core](https://dotnetfiddle.net/C4KZbM) |
29+
| `DeferredSum` | QueryDeferred extension method. Computes the sum of a sequence | [NET Framework](https://dotnetfiddle.net/ugoMmG) / [NET Core](https://dotnetfiddle.net/U4TEb1) |
3030

3131
## Real Life Scenarios
3232
### Query Cache
@@ -50,7 +50,7 @@ context.SaveChanges();
5050
// SELECT COUNT(1) FROM Customers
5151
Console.WriteLine("Count Customer is : " + futurValue.Value);
5252
```
53-
[Try it](https://dotnetfiddle.net/OshIRK)
53+
Try it: [NET Framework](https://dotnetfiddle.net/OshIRK) | [NET Core](https://dotnetfiddle.net/I7kZ13)
5454

5555
## Documnentation
5656

@@ -59,7 +59,7 @@ Console.WriteLine("Count Customer is : " + futurValue.Value);
5959
###### Methods
6060
| Name | Description | Example |
6161
| :--- | :---------- | :------ |
62-
| `Execute()` | Execute the deferred expression and return the result. | [Try it](https://dotnetfiddle.net/byuQpD) |
62+
| `Execute()` | Execute the deferred expression and return the result. | [NET Framework](https://dotnetfiddle.net/byuQpD) / [NET Core](https://dotnetfiddle.net/dHXqhH) |
6363
| `ExecuteAsync()` | Execute asynchrounously the deferred expression and return the result. | [Coming soon](#) |
6464
| `ExecuteAsync(CancellationToken cancellationToken)` | Execute asynchrounously the deferred expression and return the result. | [Coming soon](#) |
6565

docs/pages/features/query-filter.md

+19-19
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class EntityContext : DbContext
1818
// SELECT * FROM Customers WHERE IsDeleted = 0
1919
var list = context.Customers.ToList();
2020
```
21-
[Try it](https://dotnetfiddle.net/aDsTWW)
21+
Try it: [NET Framework](https://dotnetfiddle.net/aDsTWW) | [NET Core](https://dotnetfiddle.net/g1XRz1)
2222

2323
The filter is applied in the database and application side:
2424
- **Database side**: Whenever possible, the filter is applied in the SQL query.
@@ -65,7 +65,7 @@ public class EntityContext : DbContext
6565
// SELECT * FROM Customers WHERE IsDeleted = 0
6666
var list = context.Customers.ToList();
6767
```
68-
[Try it](https://dotnetfiddle.net/7cKY2x)
68+
Try it: [NET Framework](https://dotnetfiddle.net/7cKY2x) | [NET Core](https://dotnetfiddle.net/cgSy5d)
6969

7070
### Instance Query Filter
7171
You can create an **Instance Query Filter** after a context instance has been created. This filter will be specific to this context instance. If your context instance already has query filter both filters will be enabled.
@@ -82,7 +82,7 @@ using (var context = new EntityContext())
8282
FiddleHelper.WriteTable("Customers", list);
8383
}
8484
```
85-
[Try it](https://dotnetfiddle.net/qjRFbZ)
85+
Try it: [NET Framework](https://dotnetfiddle.net/qjRFbZ) | [NET Core](https://dotnetfiddle.net/S2tCDX)
8686

8787
### Enable/Disable Query Filter
8888
You can enable/disable your **Query Filter** with the `Enable()`, `Disable()`, `EnableFilter(id)`, and `DisableFilder(id)` methods.
@@ -135,7 +135,7 @@ using (var context = new EntityContext())
135135
}
136136
}
137137
```
138-
[Try it](https://dotnetfiddle.net/tctGi0)
138+
Try it: [NET Framework](https://dotnetfiddle.net/tctGi0) | [NET Core](https://dotnetfiddle.net/hxOZQz)
139139

140140
> DANGER: DO NOT disable `Global Query Filter` unless you want to disable the filter for all your context instances.
141141
@@ -163,7 +163,7 @@ public class EntityContext : DbContext
163163
// SELECT * FROM Customers WHERE IsDeleted = 0
164164
var list = context.Customers.ToList();
165165
```
166-
[Try it](https://dotnetfiddle.net/b1kwHs)
166+
Try it: [NET Framework](https://dotnetfiddle.net/b1kwHs) | [NET Core](https://dotnetfiddle.net/dVOBXI)
167167

168168
> HINT: The filter is usually applied to an interface named `ISoftDelete` inherited by all entity types that use Soft Delete.
169169
@@ -189,7 +189,7 @@ public class EntityContext : DbContext
189189
// SELECT * FROM Customers WHERE TenantID = 1
190190
var list = context.Customers.ToList();
191191
```
192-
[Try it](https://dotnetfiddle.net/WuWGCy)
192+
Try it: [NET Framework](https://dotnetfiddle.net/WuWGCy) | [NET Core](https://dotnetfiddle.net/9WAJRN)
193193

194194
> HINT: The filter is usually applied to an interface named `ITenant` inherited by all entity types that use multi-tenancy.
195195
@@ -222,7 +222,7 @@ public class EntityContext : DbContext
222222
public DbSet<Customer> Customers { get; set; }
223223
}
224224
```
225-
[Try it](https://dotnetfiddle.net/HP9Fbe)
225+
Try it: [NET Framework](https://dotnetfiddle.net/HP9Fbe) | [NET Core](https://dotnetfiddle.net/YU8JLJ)
226226

227227
## Documentation
228228

@@ -232,34 +232,34 @@ public class EntityContext : DbContext
232232

233233
| Name | Description | Example |
234234
| :--- | :---------- | :------ |
235-
| `ID` | Gets the `QueryFilter` ID. | [Try it](https://dotnetfiddle.net/8z8spq) |
236-
| `EntityType` | Gets the `QueryFilter` entity type on which the filter is applied. | [Try it](https://dotnetfiddle.net/DP6Del) |
237-
| `IsEnabled` | Gets if the `QueryFilter` is enabled. Use `Enable()` and `Disable()` method to change the state. Always return false if the `QueryFilter` feature is disabled. | [Try it](https://dotnetfiddle.net/28AdvH) |
235+
| `ID` | Gets the `QueryFilter` ID. | [NET Framework](https://dotnetfiddle.net/8z8spq) / [NET Core](https://dotnetfiddle.net/5Y5heH) |
236+
| `EntityType` | Gets the `QueryFilter` entity type on which the filter is applied. | [NET Framework](https://dotnetfiddle.net/DP6Del) / [NET Core](https://dotnetfiddle.net/qDSiY3) |
237+
| `IsEnabled` | Gets if the `QueryFilter` is enabled. Use `Enable()` and `Disable()` method to change the state. Always return false if the `QueryFilter` feature is disabled. | [NET Framework](https://dotnetfiddle.net/28AdvH) / [NET Core](https://dotnetfiddle.net/BvMqCw) |
238238

239239
###### Methods
240240

241241
| Name | Description | Example |
242242
| :--- | :---------- | :------ |
243-
| `Enable()` | Enable the `QueryFilter`. | [Try it](https://dotnetfiddle.net/H7cqIU) |
244-
| `Disable()` | Disable the `QueryFilter`. | [Try it](https://dotnetfiddle.net/ArFGJh) |
243+
| `Enable()` | Enable the `QueryFilter`. | [NET Framework](https://dotnetfiddle.net/H7cqIU) / [NET Core](https://dotnetfiddle.net/6BeUbX) |
244+
| `Disable()` | Disable the `QueryFilter`. | [NET Framework](https://dotnetfiddle.net/ArFGJh) / [NET Core](https://dotnetfiddle.net/AIYH9v) |
245245

246246
### QueryFilterManager
247247

248248
###### Properties
249249

250250
| Name | Description | Example |
251251
| :--- | :---------- | :------ |
252-
| `IsEnabled` | Gets or sets if the `QueryFilter` feature is enabled. | [Try it](https://dotnetfiddle.net/ykhwxO) |
252+
| `IsEnabled` | Gets or sets if the `QueryFilter` feature is enabled. | [NET Framework](https://dotnetfiddle.net/ykhwxO) / [NET Core](https://dotnetfiddle.net/jAM0rJ) |
253253

254254
###### Methods
255255

256256
| Name | Description | Example |
257257
| :--- | :---------- | :------ |
258-
| `Filter<T>(Expression<Func<T, bool>> filter)` | Filter an entity type using a predicate. | [Try it](https://dotnetfiddle.net/lqfF8b) |
259-
| `Filter<T>(string id, Expression<Func<T, bool>> filter)` | Filter an entity type using a predicate. The `QueryFilter` will be created with the specified ID. | [Try it](https://dotnetfiddle.net/dBOdw2) |
260-
| `EnableFilter(string id)` | Enable the `QueryFilter` with the specified id. | [Try it](https://dotnetfiddle.net/q7T7nl) |
261-
| `DisableFilter(string id)` | Disable the `QueryFilter` with the specified id. | [Try it](https://dotnetfiddle.net/Zoric3) |
262-
| `GetFilter(string id)` | Get the `QueryFilter` with the specified id. | [Try it](https://dotnetfiddle.net/2IBfGq) |
258+
| `Filter<T>(Expression<Func<T, bool>> filter)` | Filter an entity type using a predicate. | [NET Framework](https://dotnetfiddle.net/lqfF8b) / [NET Core](https://dotnetfiddle.net/fIcXBz) |
259+
| `Filter<T>(string id, Expression<Func<T, bool>> filter)` | Filter an entity type using a predicate. The `QueryFilter` will be created with the specified ID. | [NET Framework](https://dotnetfiddle.net/dBOdw2) / [NET Core](https://dotnetfiddle.net/z4Ls0g) |
260+
| `EnableFilter(string id)` | Enable the `QueryFilter` with the specified id. | [NET Framework](https://dotnetfiddle.net/q7T7nl) / [NET Core](https://dotnetfiddle.net/beR6We) |
261+
| `DisableFilter(string id)` | Disable the `QueryFilter` with the specified id. | [NET Framework](https://dotnetfiddle.net/Zoric3) / [NET Core](https://dotnetfiddle.net/x981TW) |
262+
| `GetFilter(string id)` | Get the `QueryFilter` with the specified id. | [NET Framework](https://dotnetfiddle.net/2IBfGq) / [NET Core](https://dotnetfiddle.net/CkHI8j) |
263263

264264
## Limitations
265265

@@ -296,7 +296,7 @@ using (var context = new EntityContext())
296296
Console.WriteLine("Object reference equals: " + object.ReferenceEquals(customerA, customerB));
297297
}
298298
```
299-
[Try it](https://dotnetfiddle.net/oPE2ve)
299+
Try it: [NET Framework](https://dotnetfiddle.net/oPE2ve) | [NET Core](https://dotnetfiddle.net/OZ1Jvj)
300300

301301
## FAQ
302302

docs/pages/features/query-future.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var ActiveCustomers = context.Customers.Where(x => x.IsActive).Future();
2222
FiddleHelper.WriteTable("Customers", customers.ToList());
2323
FiddleHelper.WriteTable("Active Customers", ActiveCustomers);
2424
```
25-
[Try it](https://dotnetfiddle.net/DoWJ3t)
25+
Try it: [NET Framework](https://dotnetfiddle.net/DoWJ3t) | [NET Core](https://dotnetfiddle.net/vMGvuy)
2626

2727
## Documentation
2828

@@ -32,7 +32,7 @@ FiddleHelper.WriteTable("Active Customers", ActiveCustomers);
3232

3333
| Name | Description | Default | Example |
3434
| :--- | :---------- | :-----: | :------ |
35-
| `IsEnabled` | Gets or sets if the `QueryFuture` feature is enabled. | true | [Try it](https://dotnetfiddle.net/n6VcfE) |
35+
| `IsEnabled` | Gets or sets if the `QueryFuture` feature is enabled. | true | [NET Framework](https://dotnetfiddle.net/n6VcfE) / [NET Core](https://dotnetfiddle.net/ezWALV) |
3636

3737
### QueryFutureEnumerable<TEntityType>
3838

@@ -53,7 +53,7 @@ The `QueryFutureEnumerable<TEntityType>` inherit from the `IEnumerable<T>` inter
5353

5454
| Name | Description | Default | Example |
5555
| :--- | :---------- | :-----: | :------ |
56-
| `Value` | Gets the value of the future query. | null | [Try it](https://dotnetfiddle.net/ObIY3v) |
56+
| `Value` | Gets the value of the future query. | null | [NET Framework](https://dotnetfiddle.net/ObIY3v) / [NET Core](https://dotnetfiddle.net/xjEqrX) |
5757

5858
###### Methods
5959

0 commit comments

Comments
 (0)