main
|
Last change
on this file since acf690c was acf690c, checked in by kikisrbinoska <srbinoskakristina07@…>, 4 months ago |
|
Added fixes for the login,stories management and reading lists
|
-
Property mode
set to
100644
|
|
File size:
1016 bytes
|
| Rev | Line | |
|---|
| [877c13c] | 1 | using ChapterX.Domain.Entities;
|
|---|
| 2 | using ChapterX.Domain.Repositories;
|
|---|
| 3 | using ChapterX.Infrastructure.Data.DataContext;
|
|---|
| 4 | using Microsoft.EntityFrameworkCore;
|
|---|
| 5 |
|
|---|
| 6 | namespace ChapterX.Infrastructure.Repositories
|
|---|
| 7 | {
|
|---|
| 8 | public class ReadingListRepository : GenericRepository<ReadingList>, IReadingListRepository
|
|---|
| 9 | {
|
|---|
| 10 | public ReadingListRepository(ApplicationDbContext context) : base(context)
|
|---|
| 11 | {
|
|---|
| 12 | }
|
|---|
| 13 |
|
|---|
| [acf690c] | 14 | public override async Task<IEnumerable<ReadingList>> GetAllAsync(CancellationToken cancellationToken = default)
|
|---|
| 15 | {
|
|---|
| 16 | return await _dbSet
|
|---|
| 17 | .Include(r => r.ReadingListItems)
|
|---|
| 18 | .ToListAsync(cancellationToken);
|
|---|
| 19 | }
|
|---|
| 20 |
|
|---|
| [877c13c] | 21 | public async Task<IEnumerable<ReadingList>> GetByUserIdAsync(int userId, CancellationToken cancellationToken = default)
|
|---|
| 22 | {
|
|---|
| 23 | return await _dbSet
|
|---|
| 24 | .Where(r => r.UserId == userId)
|
|---|
| [acf690c] | 25 | .Include(r => r.ReadingListItems)
|
|---|
| [877c13c] | 26 | .ToListAsync(cancellationToken);
|
|---|
| 27 | }
|
|---|
| 28 | }
|
|---|
| 29 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.