source: ChapterX.Application/Notify/Queries/GetAllHandler.cs@ e294f7d

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

Added files

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