source: ChapterX.Infrastructure/Repositories/ChapterRepository.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: 795 bytes
Line 
1using ChapterX.Domain.Entities;
2using ChapterX.Domain.Repositories;
3using ChapterX.Infrastructure.Data.DataContext;
4using System;
5using System.Collections.Generic;
6using System.Linq;
7using System.Text;
8using System.Threading.Tasks;
9
10using Microsoft.EntityFrameworkCore;
11
12namespace ChapterX.Infrastructure.Repositories
13{
14 public class ChapterRepository : GenericRepository<Chapter>, IChapterRepository
15 {
16 public ChapterRepository(ApplicationDbContext context) : base(context)
17 {
18 }
19
20 public async Task<IEnumerable<Chapter>> GetByStoryIdAsync(int storyId, CancellationToken cancellationToken = default)
21 {
22 return await _dbSet
23 .Where(c => c.StoryId == storyId)
24 .ToListAsync(cancellationToken);
25 }
26 }
27}
Note: See TracBrowser for help on using the repository browser.