source: ChapterX.Application/Story/Queries/GetAllHandler.cs@ 99c1e45

main
Last change on this file since 99c1e45 was 877c13c, checked in by kikisrbinoska <srbinoskakristina07@…>, 4 months ago

Added files

  • Property mode set to 100644
File size: 798 bytes
Line 
1using ChapterX.Domain.Repositories;
2using MediatR;
3using Microsoft.Extensions.Logging;
4
5namespace ChapterX.Application.Story.Queries
6{
7 public class GetAllHandler : IRequestHandler<GetAllRequest, GetAllResponse>
8 {
9 private readonly IStoryRepository _storyRepository;
10 private readonly ILogger<GetAllHandler> _logger;
11
12 public GetAllHandler(IStoryRepository storyRepository, ILogger<GetAllHandler> logger)
13 {
14 _storyRepository = storyRepository;
15 _logger = logger;
16 }
17
18 public async Task<GetAllResponse> Handle(GetAllRequest request, CancellationToken cancellationToken)
19 {
20 var stories = await _storyRepository.GetAllAsync(cancellationToken);
21 return new GetAllResponse(stories);
22 }
23 }
24}
Note: See TracBrowser for help on using the repository browser.