main
|
Last change
on this file since e294f7d was 877c13c, checked in by kikisrbinoska <srbinoskakristina07@…>, 4 months ago |
|
Added files
|
-
Property mode
set to
100644
|
|
File size:
733 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 StoryRepository : GenericRepository<Story>, IStoryRepository
|
|---|
| 9 | {
|
|---|
| 10 | public StoryRepository(ApplicationDbContext context) : base(context)
|
|---|
| 11 | {
|
|---|
| 12 | }
|
|---|
| 13 |
|
|---|
| 14 | public async Task<IEnumerable<Story>> GetByWriterIdAsync(int writerId, CancellationToken cancellationToken = default)
|
|---|
| 15 | {
|
|---|
| 16 | return await _dbSet
|
|---|
| 17 | .Include(s => s.Writer)
|
|---|
| 18 | .Where(s => s.Writer != null && s.Writer.Id == writerId)
|
|---|
| 19 | .ToListAsync(cancellationToken);
|
|---|
| 20 | }
|
|---|
| 21 | }
|
|---|
| 22 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.