using ChapterX.Domain.Repositories; using MediatR; using Microsoft.Extensions.Logging; namespace ChapterX.Application.Collaboration.Queries { public class GetHandler : IRequestHandler { private readonly ICollaborationRepository _collaborationRepository; private readonly ILogger _logger; public GetHandler(ICollaborationRepository collaborationRepository, ILogger logger) { _collaborationRepository = collaborationRepository; _logger = logger; } public async Task Handle(GetRequest request, CancellationToken cancellationToken) { var collaboration = await _collaborationRepository.GetByIdAsync(request.Id, cancellationToken); return new GetResponse(collaboration); } } }