source: ChapterX.Application/AISuggestion/Queries/GetByChapterHandler.cs

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: 943 bytes
Line 
1using ChapterX.Domain.Repositories;
2using MediatR;
3using Microsoft.Extensions.Logging;
4
5namespace ChapterX.Application.AISuggestion.Queries
6{
7 public class GetByChapterHandler : IRequestHandler<GetByChapterRequest, GetByChapterResponse>
8 {
9 private readonly IAISuggestionRepository _aiSuggestionRepository;
10 private readonly ILogger<GetByChapterHandler> _logger;
11
12 public GetByChapterHandler(IAISuggestionRepository aiSuggestionRepository, ILogger<GetByChapterHandler> logger)
13 {
14 _aiSuggestionRepository = aiSuggestionRepository;
15 _logger = logger;
16 }
17
18 public async Task<GetByChapterResponse> Handle(GetByChapterRequest request, CancellationToken cancellationToken)
19 {
20 var suggestions = await _aiSuggestionRepository.GetByChapterIdAsync(request.ChapterId, cancellationToken);
21 return new GetByChapterResponse(suggestions);
22 }
23 }
24}
Note: See TracBrowser for help on using the repository browser.