You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/pages/features/query-deferred.md
+14-14
Original file line number
Diff line number
Diff line change
@@ -15,18 +15,18 @@ However, some features like **Query Cache** and **Query Future** cannot be used
15
15
16
16
| Name | Description | Example |
17
17
| :--- | :---------- | :------ |
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)|
30
30
31
31
## Real Life Scenarios
32
32
### Query Cache
@@ -50,7 +50,7 @@ context.SaveChanges();
50
50
// SELECT COUNT(1) FROM Customers
51
51
Console.WriteLine("Count Customer is : "+futurValue.Value);
|`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)|
63
63
|`ExecuteAsync()`| Execute asynchrounously the deferred expression and return the result. |[Coming soon](#)|
64
64
|`ExecuteAsync(CancellationToken cancellationToken)`| Execute asynchrounously the deferred expression and return the result. |[Coming soon](#)|
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())
@@ -232,34 +232,34 @@ public class EntityContext : DbContext
232
232
233
233
| Name | Description | Example |
234
234
| :--- | :---------- | :------ |
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)|
238
238
239
239
###### Methods
240
240
241
241
| Name | Description | Example |
242
242
| :--- | :---------- | :------ |
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)|
245
245
246
246
### QueryFilterManager
247
247
248
248
###### Properties
249
249
250
250
| Name | Description | Example |
251
251
| :--- | :---------- | :------ |
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)|
253
253
254
254
###### Methods
255
255
256
256
| Name | Description | Example |
257
257
| :--- | :---------- | :------ |
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)|
263
263
264
264
## Limitations
265
265
@@ -296,7 +296,7 @@ using (var context = new EntityContext())
|`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)|
36
36
37
37
### QueryFutureEnumerable<TEntityType>
38
38
@@ -53,7 +53,7 @@ The `QueryFutureEnumerable<TEntityType>` inherit from the `IEnumerable<T>` inter
53
53
54
54
| Name | Description | Default | Example |
55
55
| :--- | :---------- | :-----: | :------ |
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)|
0 commit comments