Skip to content

Commit 001e56f

Browse files
committed
docs(readme): document overriding repositories
1 parent d275202 commit 001e56f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,4 +160,15 @@ when setting up the services:
160160
```
161161
services.AddJsonApi<AppDbContext>(
162162
opt => opt.DefaultPageSize = 10);
163-
```
163+
```
164+
165+
## Defining Custom Data Access Methods
166+
167+
You can implement custom methods for accessing the data by creating an implementation of
168+
`IEntityRepository<TEntity, TId>`. If you only need minor changes you can override the
169+
methods defined in `DefaultEntityRepository<TEntity, TId>`. The repository should then be
170+
add to the service collection in `Startup.ConfigureServices` like so:
171+
172+
```
173+
services.AddScoped<IEntityRepository<MyEntity,Guid>, MyEntityRepository>();
174+
```

0 commit comments

Comments
 (0)