Skip to content

Commit d2ef98e

Browse files
committed
docs(readme): document the new controller attribute
1 parent 7276ee0 commit d2ef98e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ JsonApiDotnetCore provides a framework for building [json:api](http://jsonapi.or
2222
- [Non-Integer Type Keys](#non-integer-type-keys)
2323
- [Routing](#routing)
2424
- [Namespacing and Versioning URLs](#namespacing-and-versioning-urls)
25+
- [Disable Convention](#disable-convention)
2526
- [Defining Custom Data Access Methods](#defining-custom-data-access-methods)
2627
- [Pagination](#pagination)
2728
- [Filtering](#filtering)
@@ -244,6 +245,24 @@ services.AddJsonApi<AppDbContext>(
244245
opt => opt.Namespace = "api/v1");
245246
```
246247

248+
#### Disable Convention
249+
250+
You can disable the dasherized convention and specify your own template
251+
by using the `DisableRoutingConvention` Attribute:
252+
253+
```csharp
254+
[DisableRoutingConvention]
255+
public class CamelCasedModelsController : JsonApiController<CamelCasedModel>
256+
{
257+
public CamelCasedModelsController(
258+
IJsonApiContext jsonApiContext,
259+
IResourceService<CamelCasedModel> resourceService,
260+
ILoggerFactory loggerFactory)
261+
: base(jsonApiContext, resourceService, loggerFactory)
262+
{ }
263+
}
264+
```
265+
247266
### Defining Custom Data Access Methods
248267

249268
By default, data retrieval is distributed across 3 layers:

0 commit comments

Comments
 (0)