File tree 1 file changed +18
-0
lines changed 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ JsonApiDotnetCore provides a framework for building [json:api](http://jsonapi.or
17
17
- [Defining Models](#defining-models)
18
18
- [Specifying Public Attributes](#specifying-public-attributes)
19
19
- [Relationships](#relationships)
20
+ - [Resource Names](#resource-names)
20
21
- [Defining Controllers](#defining-controllers)
21
22
- [Non-Integer Type Keys](#non-integer-type-keys)
22
23
- [Routing](#routing)
@@ -169,6 +170,23 @@ public class TodoItem : Identifiable<int>
169
170
}
170
171
```
171
172
173
+ #### Resource Names
174
+
175
+ If a DbContext is specified when adding the services, the context will be used to define the resources and their names.
176
+
177
+ ``` csharp
178
+ public DbSet < MyModel > SomeModels { get ; set ; } // this will be translated into "some-models"
179
+ ```
180
+
181
+ However, you can specify a custom name like so:
182
+
183
+ ``` csharp
184
+ [Resource (" some-models" )]
185
+ public DbSet < MyModel > MyModels { get ; set ; } // this will be translated into "some-models"
186
+ ```
187
+
188
+ For further resource customizations, please see the section on [ Defining Custom Data Access Methods] ( #defining-custom-data-access-methods ) .
189
+
172
190
### Defining Controllers
173
191
174
192
You need to create controllers that inherit from ` JsonApiController<TEntity> ` or ` JsonApiController<TEntity, TId> `
You can’t perform that action at this time.
0 commit comments