public Task <SearchResult <ProcessFileResult> > Handle(SearchProcessFilesQuery request, CancellationToken cancellationToken) { return(_processFileQueryRepository.Find(new Persistence.Parameters.FindProcessFilesParameter { Count = request.Count, Order = request.Order, OrderBy = request.OrderBy, StartIndex = request.StartIndex, TakeLatest = request.TakeLatest, FileId = request.FileId }, cancellationToken)); }
public async Task <SearchResult <ProcessFileResult> > Handle(SearchProcessFilesQuery request, CancellationToken cancellationToken) { var result = await _processFileQueryRepository.Find(new Persistence.Parameters.FindProcessFilesParameter { Count = request.Count, Order = request.Order, OrderBy = request.OrderBy, StartIndex = request.StartIndex, TakeLatest = request.TakeLatest, FileId = request.FileId }, cancellationToken); return(new SearchResult <ProcessFileResult> { Content = result.Content.Select(_ => ProcessFileResult.ToDto(_)), Count = result.Count, StartIndex = result.StartIndex, TotalLength = result.TotalLength }); }
public async Task <IActionResult> Search([FromBody] SearchProcessFilesQuery query, CancellationToken token) { var result = await _mediator.Send(query, token); return(new OkObjectResult(result)); }