Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paged results #21

Open
garrjo opened this issue Mar 21, 2020 · 6 comments
Open

Paged results #21

garrjo opened this issue Mar 21, 2020 · 6 comments

Comments

@garrjo
Copy link

garrjo commented Mar 21, 2020

I'm attempting to write a Paged Query and I have configured it to do so; however, the yielded result set is atypical of what normally would occur in a result set coming from MighyOrm. Do we have more documentation to give me an example of how exactly is the best practice to work wiith a PagedResult?
var tbl = new Mighty.StartingAccounts(); var page = tbl.Paged(currentPage: currentPage, pageSize: 100, columns:"Id");
As I'd like to work with them in a list I'm unfamiliar with how to bring them to it? Since the result is PagedResults ... Can you give me a hint here?

@mikebeaton
Copy link
Member

I was hoping this should be fairly self explanatory based on IntelliSense?

The PagedResults object has fields Items, TotalPages and TotalRecords. If you just type . next to a PagedResults object in Visual Studio or VS Code then it should show them to you as auto-complete options? And the fields themselves have IntelliSense.

Does that help? Is IntelliSense all working for you? It should be since v. 3.0.5 and 66f0106 .

@garrjo
Copy link
Author

garrjo commented Mar 21, 2020 via email

@mikebeaton
Copy link
Member

mikebeaton commented Mar 22, 2020

@garrjo I'm gathering that what would have helped here is just a bit more detail in the current docs on paging, right?

@garrjo
Copy link
Author

garrjo commented Mar 22, 2020 via email

@mikebeaton
Copy link
Member

mikebeaton commented Mar 23, 2020

Fair point! :)

I'm trying to match - but not necessarily exceed, given available time and resources! - the detail of the docs for Massive. So I agree I should document the fields that are in PagedResults (in the docs, not just in IntelliSense!), and also the reason for having them; namely, that you can't show a user paging info unless the call to the paging method returns the total number of pages/items along with the items for the current page.

So I'll leave this Issue open pending adding this info to the docs.

@garrjo
Copy link
Author

garrjo commented Mar 23, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants