public Task <SearchResult <ProcessInstanceResult> > Handle(SearchProcessInstancesQuery request, CancellationToken cancellationToken)
 {
     return(_processInstanceQueryRepository.Find(new FindProcessInstancesParameter
     {
         Count = request.Count,
         Order = request.Order,
         OrderBy = request.OrderBy,
         ProcessFileId = request.ProcessFileId,
         StartIndex = request.StartIndex,
         Status = request.Status
     }, cancellationToken));
 }
        public async Task <SearchResult <ProcessInstanceResult> > Handle(SearchProcessInstancesQuery request, CancellationToken cancellationToken)
        {
            var result = await _processInstanceQueryRepository.Find(new FindProcessInstancesParameter
            {
                Count         = request.Count,
                Order         = request.Order,
                OrderBy       = request.OrderBy,
                ProcessFileId = request.ProcessFileId,
                StartIndex    = request.StartIndex,
                Status        = (int?)request.Status
            }, cancellationToken);

            return(new SearchResult <ProcessInstanceResult>
            {
                Content = result.Content.Select(_ => ProcessInstanceResult.ToDto(_)),
                Count = result.Count,
                StartIndex = result.StartIndex,
                TotalLength = result.TotalLength
            });
        }