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: README.md
+122-24
Original file line number
Diff line number
Diff line change
@@ -9,18 +9,18 @@
9
9
JsonApiDotnetCore provides a framework for building [json:api](http://jsonapi.org/) compliant web servers. Unlike other .Net implementations, this library provides all the required middleware to build a complete server. All you need to focus on is defining the resources. However, the library is also fully extensible so you can customize the implementation to meet your specific needs.
10
10
11
11
# Table Of Contents
12
-
-[Comprehensive Demo](#comprehensive-demo)
13
12
-[Installation](#installation)
14
-
-[Generators](#generators)
15
13
-[Usage](#usage)
16
14
- [Middleware and Services](#middleware-and-services)
17
15
- [Defining Models](#defining-models)
18
16
- [Specifying Public Attributes](#specifying-public-attributes)
19
17
- [Relationships](#relationships)
18
+
- [Resource Names](#resource-names)
20
19
- [Defining Controllers](#defining-controllers)
21
20
- [Non-Integer Type Keys](#non-integer-type-keys)
22
21
- [Routing](#routing)
23
22
- [Namespacing and Versioning URLs](#namespacing-and-versioning-urls)
23
+
- [Disable Convention](#disable-convention)
24
24
- [Defining Custom Data Access Methods](#defining-custom-data-access-methods)
25
25
- [Pagination](#pagination)
26
26
- [Filtering](#filtering)
@@ -32,12 +32,6 @@ JsonApiDotnetCore provides a framework for building [json:api](http://jsonapi.or
32
32
- [Sparse Fieldsets](#sparse-fieldsets)
33
33
-[Tests](#tests)
34
34
35
-
## Comprehensive Demo
36
-
37
-
The following is a WIP demo showing how to create a web application using this library, EmberJS and PostgreSQL. If there are specific topics you'd like to see in future videos, comment on the playlist.
You can implement custom methods for accessing the data by creating an implementation of
269
+
By default, data retrieval is distributed across 3 layers:
270
+
271
+
1.`JsonApiController`
272
+
2.`EntityResourceService`
273
+
3.`DefaultEntityRepository`
274
+
275
+
Customization can be done at any of these layers. However, it is recommended that you make your customizations at the service or the repository layer when possible to keep the controllers free of unnecessary logic.
276
+
277
+
#### Not Using Entity Framework?
278
+
279
+
Out of the box, the library uses your `DbContext` to create a "ContextGraph" or map of all your models and their relationships. If, however, you have models that are not members of a `DbContext`, you can manually create this graph like so:
By default, this library uses Entity Framework. If you'd like to use another ORM that does not implement `IQueryable`, you can inject a custom service like so:
If you want to use EF, but need additional data access logic (such as authorization), you can implement custom methods for accessing the data by creating an implementation of
232
330
`IEntityRepository<TEntity, TId>`. If you only need minor changes you can override the
233
331
methods defined in `DefaultEntityRepository<TEntity, TId>`. The repository should then be
234
332
add to the service collection in `Startup.ConfigureServices` like so:
0 commit comments