Exemple #1
0
 public Task <SearchResult <CasePlanInstanceResult> > Handle(SearchCasePlanInstanceQuery request, CancellationToken cancellationToken)
 {
     return(_casePlanInstanceQueryRepository.Find(new FindCasePlanInstancesParameter
     {
         CasePlanId = request.CasePlanId,
         CaseFileId = request.CaseFileId,
         Count = request.Count,
         Order = request.Order,
         OrderBy = request.OrderBy,
         StartIndex = request.StartIndex
     }, cancellationToken));
 }
        public async Task <SearchResult <CasePlanInstanceResult> > Handle(SearchCasePlanInstanceQuery request, CancellationToken cancellationToken)
        {
            var result = await _casePlanInstanceQueryRepository.Find(new FindCasePlanInstancesParameter
            {
                CasePlanId = request.CasePlanId,
                Count      = request.Count,
                Order      = request.Order,
                OrderBy    = request.OrderBy,
                StartIndex = request.StartIndex
            }, cancellationToken);

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