public async Task <IActionResult> GetAllResourcesAsync() { var command = new GetAllResources(); var result = await _mediator.Send(command); return(Ok(result)); }
public async Task <PagedList <GetAllResourceDto> > Handle(GetAllResources request, CancellationToken cancellationToken) { var resources = await _resourceRepository.Resources.AsNoTracking().ToListAsync(cancellationToken); var result = resources.Select(GetAllResourceDto.Create); return(PagedList <GetAllResourceDto> .Create(result)); }