Ignore:
Timestamp:
03/24/26 22:13:36 (3 months ago)
Author:
kikisrbinoska <srbinoskakristina07@…>
Branches:
main
Children:
7fbb91c
Parents:
acf690c
Message:

Fixed reading lists,comments and likes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ChapterX.Infrastructure/Repositories/CommentRepository.cs

    racf690c r73b69b2  
    1919
    2020        public async Task<IEnumerable<Comment>> GetByChapterIdAsync(int chapterId, CancellationToken cancellationToken = default)
    21         {
    22             return await _dbSet
    23                 .Where(c => c.StoryId == chapterId)
     21            => await _dbSet.Where(c => c.StoryId == chapterId).ToListAsync(cancellationToken);
     22
     23        public async Task<IEnumerable<Comment>> GetByStoryIdAsync(int storyId, CancellationToken cancellationToken = default)
     24            => await _dbSet
     25                .Include(c => c.User)
     26                .Where(c => c.StoryId == storyId)
     27                .OrderByDescending(c => c.CreatedAt)
    2428                .ToListAsync(cancellationToken);
    25         }
    2629    }
    2730}
Note: See TracChangeset for help on using the changeset viewer.