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/usage/extensibility/layer-overview.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,8 +23,6 @@ on your needs, you may want to replace other parts by deriving from the built-in
23
23
24
24
## Replacing injected services
25
25
26
-
**Note:** If you're using [auto-discovery](~/usage/resource-graph.md#auto-discovery), then resource services, repositories and resource definitions will be automatically registered for you.
27
-
28
26
Replacing built-in services is done on a per-resource basis and can be done at startup.
29
27
For convenience, extension methods are provided to register layers on all their implemented interfaces.
> If you're using [auto-discovery](~/usage/resource-graph.md#auto-discovery), then resource services, repositories and resource definitions will be automatically registered for you.
> If you're using [auto-discovery](~/usage/resource-graph.md#auto-discovery), then resource services, repositories and resource definitions will be automatically registered for you.
23
+
23
24
A sample implementation that performs authorization might look like this.
24
25
25
26
All of the methods in EntityFrameworkCoreRepository will use the `GetAll()` method to get the `DbSet<TResource>`, so this is a good method to apply filters such as user or tenant authorization.
**Note:** Prior to the introduction of auto-discovery (in v3), you needed to register the
18
-
resource definition on the container yourself:
15
+
> [!TIP]
16
+
> If you're using [auto-discovery](~/usage/resource-graph.md#auto-discovery), then resource services, repositories and resource definitions will be automatically registered for you.
**Note:** to exclude fields unconditionally, [attribute capabilities](~/usage/resources/attributes.md#capabilities) and [relationship capabilities](~/usage/resources/relationships.md#capabilities) can be used instead.
40
+
> [!NOTE]
41
+
>Toexcludefieldsunconditionally, [attributecapabilities](~/usage/resources/attributes.md#capabilities) and [relationshipcapabilities](~/usage/resources/relationships.md#capabilities) canbeusedinstead.
You can define additional query string parameters with the LINQ expression that should be used.
219
220
If the key is present in a query string, the supplied LINQ expression will be added to the database query.
220
221
221
-
Note this directly influences the Entity Framework Core `IQueryable`. As opposed to using `OnApplyFilter`, this enables the full range of Entity Framework Core operators.
222
+
> [!NOTE]
223
+
> This directly influences the Entity Framework Core `IQueryable`. As opposed to using `OnApplyFilter`, this enables the full range of Entity Framework Core operators.
222
224
But it only works on primary resource endpoints (for example: /articles, but not on /blogs/1/articles or /blogs?include=articles).
> If you're using [auto-discovery](~/usage/resource-graph.md#auto-discovery), then resource services, repositories and resource definitions will be automatically registered for you.
145
+
145
146
Then on your model, pass in the set of endpoints to expose (the ones that you've registered services for):
The default page size used for all resources can be overridden in options (10 by default). To disable paging, set it to `null`.
26
26
The maximum page size and number allowed from client requests can be set too (unconstrained by default).
27
-
You can also include the total number of resources in each response. Note that when using this feature, it does add some query overhead since we have to also request the total number of resources.
27
+
28
+
You can also include the total number of resources in each response.
29
+
30
+
> [!NOTE]
31
+
> Including the total number of resources adds some overhead, because the count is fetched in a separate query.
Copy file name to clipboardExpand all lines: docs/usage/reading/filtering.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,7 +69,8 @@ GET /articles?include=author,tags&filter=equals(author.lastName,'Smith')&filter[
69
69
70
70
In the above request, the first filter is applied on the collection of articles, while the second one is applied on the nested collection of tags.
71
71
72
-
Note this does **not** hide articles without any matching tags! Use the `has` function with a filter condition (see below) to accomplish that.
72
+
> [!WARNING]
73
+
> The request above does **not** hide articles without any matching tags! Use the `has` function with a filter condition (see below) to accomplish that.
73
74
74
75
Putting it all together, you can build quite complex filters, such as:
Copy file name to clipboardExpand all lines: docs/usage/reading/sparse-fieldset-selection.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,8 @@ Example for both top-level and relationship:
36
36
GET /articles?include=author&fields[articles]=title,body,author&fields[authors]=name HTTP/1.1
37
37
```
38
38
39
-
Note that in the last example, the `author` relationship is also added to the `articles` fieldset, so that the relationship from article to author is returned.
39
+
> [!NOTE]
40
+
> In the last example, the `author` relationship is also added to the `articles` fieldset, so that the relationship from article to author is returned.
40
41
When omitted, you'll get the included resources returned, but without full resource linkage (as described [here](https://jsonapi.org/examples/#sparse-fieldsets)).
0 commit comments