source: ChapterX.Infrastructure/Repositories/StoryRepository.cs@ 877c13c

main
Last change on this file since 877c13c was 877c13c, checked in by kikisrbinoska <srbinoskakristina07@…>, 4 months ago

Added files

  • Property mode set to 100644
File size: 733 bytes
Line 
1using ChapterX.Domain.Entities;
2using ChapterX.Domain.Repositories;
3using ChapterX.Infrastructure.Data.DataContext;
4using Microsoft.EntityFrameworkCore;
5
6namespace 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.