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/routing.md
+7-17
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,10 @@ GET /api/compoundModels HTTP/1.1
7
7
8
8
There are two ways the library will try to create a route for a controller:
9
9
1.**By inspecting the controller for an associated resource**. The library will try to first use the public resource name of the resource associated to a controller. This means that the value of the `type` member of the json:api document for a resource will be equal to the route.
10
-
Note that this implies that it is possible to configure a route configuring the exposed resource name. See [this section](~/usage/resource-graph.md#public-resource-name) on how this can be achieved.
11
-
For example:
10
+
Note that this implies that it is possible to configure a route configuring the exposed resource name. See [this section](~/usage/resource-graph.md#public-resource-name) on how this can be achieved. Example:
2.**By using the name of the controller**. If no associated resource was detected for a controller, the library will construct a route from the name of the controller by using the configured naming strategy (*camelCase* by default, see [this section](~/usage/resource-graph.md#public-resource-name) on how to configure this).
32
-
In the following example the controller does not inherit from `BaseJsonApiController<T>` and the library is unable associate a resource to it.
30
+
2.**By using the name of the controller**. If no associated resource was detected for a controller, the library will construct a route from the name of the controller by using the configured naming strategy (*camelCase* by default, see [this section](~/usage/resource-graph.md#public-resource-name) on how to configure this). This is in alignment with the default .NET Core MVC routing approach.
31
+
In the following example the controller is not associated to a resource by the library because it does not inherit from `BaseJsonApiController<T>`.
@@ -63,18 +62,9 @@ Which results in URLs like: https://yourdomain.com/api/v1/people
63
62
64
63
## Disabling the Default Routing Convention
65
64
It is possible to completely bypass the default routing convention for a particular controller and specify a custom routing template by using the `DisableRoutingConvention` attribute.
66
-
In the following example, the `CamelCasedModel` resource can be accessed on `/myCustomResources` (assuming that the default naming strategy is used).
65
+
In the following example, the `CamelCasedModel` resource can be accessed on `/myCustomResources` (this assumes that the default naming strategy is unchanged).
0 commit comments