source: ChapterX.Application/Comment/Queries/GetHandler.cs@ 877c13c

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

Added files

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