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:
866 bytes
|
| Line | |
|---|
| 1 | using ChapterX.Domain.Repositories;
|
|---|
| 2 | using MediatR;
|
|---|
| 3 | using Microsoft.Extensions.Logging;
|
|---|
| 4 |
|
|---|
| 5 | namespace ChapterX.Application.NeedApproval.Queries
|
|---|
| 6 | {
|
|---|
| 7 | public class GetAllHandler : IRequestHandler<GetAllRequest, GetAllResponse>
|
|---|
| 8 | {
|
|---|
| 9 | private readonly INeedApprovalRepository _needApprovalRepository;
|
|---|
| 10 | private readonly ILogger<GetAllHandler> _logger;
|
|---|
| 11 |
|
|---|
| 12 | public GetAllHandler(INeedApprovalRepository needApprovalRepository, ILogger<GetAllHandler> logger)
|
|---|
| 13 | {
|
|---|
| 14 | _needApprovalRepository = needApprovalRepository;
|
|---|
| 15 | _logger = logger;
|
|---|
| 16 | }
|
|---|
| 17 |
|
|---|
| 18 | public async Task<GetAllResponse> Handle(GetAllRequest request, CancellationToken cancellationToken)
|
|---|
| 19 | {
|
|---|
| 20 | var needApprovals = await _needApprovalRepository.GetAllAsync(cancellationToken);
|
|---|
| 21 | return new GetAllResponse(needApprovals);
|
|---|
| 22 | }
|
|---|
| 23 | }
|
|---|
| 24 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.