using ChapterX.Domain.Repositories; using MediatR; using Microsoft.Extensions.Logging; namespace ChapterX.Application.Comment.Queries { public class GetAllHandler : IRequestHandler { private readonly ICommentRepository _commentRepository; private readonly ILogger _logger; public GetAllHandler(ICommentRepository commentRepository, ILogger logger) { _commentRepository = commentRepository; _logger = logger; } public async Task Handle(GetAllRequest request, CancellationToken cancellationToken) { var comments = await _commentRepository.GetAllAsync(cancellationToken); return new GetAllResponse(comments); } } }