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

Add support for the specification pattern in pageAsync #359

Open
d1820 opened this issue Oct 27, 2023 · 2 comments
Open

Add support for the specification pattern in pageAsync #359

d1820 opened this issue Oct 27, 2023 · 2 comments

Comments

@d1820
Copy link

d1820 commented Oct 27, 2023

Is your feature request related to a problem? Please describe.
There currently is no way to provide a complex expression easily (without writing and joining expression trees together to create an expression based on multiple query criteria, or to provide an orderBy that is almost always used in filtered paging scenarios. The specification pattern would allow for this.

Describe the solution you'd like
Add an overload to the PageAsync to take in a specification

Describe alternatives you've considered
Writing my own dynamic expression tree parser to join together an outer expression for dynamic search properties ( a search class where all non null properties need to be supplied)

@mumby0168
Copy link
Collaborator

Hi @d1820 can you provide an example query you'd like to make? The specification pattern can be used along with paging, by deriving from a different specification base type. There is some examples here, and you can also extend these base classes to add extra functionality and use multiple .Where clauses. If this isn't what you meant feel free to share an example and I can try and assist:

https://github.com/IEvangelist/azure-cosmos-dotnet-repository/blob/7430997c2d62ce9f6e0c26f124ca16bc4cd5d56a/samples/Microsoft.Azure.CosmosRepository/Specification/SpecificationPagingSamples.cs#L18C5-L61C6

@d1820
Copy link
Author

d1820 commented Dec 1, 2023 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