ardalis/Result

TranslateResultToActionResult doesn't give PagedInfo

Aberta

#71 aberto em 9 de ago. de 2021

 (5 comentários) (3 reações) (0 responsável)C# (126 forks)github user discovery
enhancementhelp wantedquestion

Métricas do repositório

Stars
 (1.034 estrelas)
Métricas de merge de PR
 (Mesclagem média 8d 3h) (2 fundiu PRs em 30d)

Description

While using TranslateResultToActionResult to return responses in the form of ActionResults, there is no way for the caller to know the details of the pagination.

The reason is because the ToActionResult method in the ResultExtensions class just cares about the "result.GetValue()" and ignores the Pagination details which were fed by the upstream services as shown below:

return Result<IEnumerable<StoryDto>>.Success(pagedStoryDtos).ToPagedResult(pagedInfo);

Is there a way we can modify this behavior so that the caller can see the pagination details too?

Guia do colaborador