ardalis/Result

TranslateResultToActionResult doesn't give PagedInfo

開放

#71 建立於 2021年8月9日

 (5 則留言) (3 個反應) (0 位負責人)C# (126 個分叉)github user discovery
enhancementhelp wantedquestion

倉庫指標

星標
 (1,034 顆星)
PR 合併指標
 (平均合併 8天 3小時) (30 天內合併 2 個 PR)

描述

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?

貢獻者指南