source: ChapterX.Application/Notify/Queries/GetHandler.cs@ 3ae4bab

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

Added files

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