main
|
Last change
on this file was a6e33d1, checked in by kikisrbinoska <srbinoskakristina07@…>, 3 days ago |
|
AI suggestions fixed
|
-
Property mode
set to
100644
|
|
File size:
905 bytes
|
| Line | |
|---|
| 1 | using ChapterX.Domain.Entities;
|
|---|
| 2 | using ChapterX.Domain.Repositories;
|
|---|
| 3 | using ChapterX.Infrastructure.Data.DataContext;
|
|---|
| 4 | using System;
|
|---|
| 5 | using System.Collections.Generic;
|
|---|
| 6 | using System.Linq;
|
|---|
| 7 | using System.Text;
|
|---|
| 8 | using System.Threading.Tasks;
|
|---|
| 9 |
|
|---|
| 10 | using Microsoft.EntityFrameworkCore;
|
|---|
| 11 |
|
|---|
| 12 | namespace ChapterX.Infrastructure.Repositories
|
|---|
| 13 | {
|
|---|
| 14 | public class AISuggestionRepository : GenericRepository<AISuggestion>, IAISuggestionRepository
|
|---|
| 15 | {
|
|---|
| 16 | public AISuggestionRepository(ApplicationDbContext context) : base(context)
|
|---|
| 17 | {
|
|---|
| 18 | }
|
|---|
| 19 |
|
|---|
| 20 | public async Task<IEnumerable<AISuggestion>> GetByChapterIdAsync(int chapterId, CancellationToken cancellationToken = default)
|
|---|
| 21 | {
|
|---|
| 22 | return await _dbSet
|
|---|
| 23 | .Include(a => a.SuggestionTypes)
|
|---|
| 24 | .Where(a => a.NeedApprovals.Any(na => na.ChapterId == chapterId))
|
|---|
| 25 | .ToListAsync(cancellationToken);
|
|---|
| 26 | }
|
|---|
| 27 | }
|
|---|
| 28 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.