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

MoralisQuery will loose filters if the query have a order by or limit filters #66

Open
Zarbuz opened this issue Sep 28, 2022 · 0 comments

Comments

@Zarbuz
Copy link

Zarbuz commented Sep 28, 2022

I have a query like this :

MoralisQuery<BuyPriceAcceptedEvent> q = await Moralis.Query<BuyPriceAcceptedEvent>();
q = q.WhereEqualTo("nftContract", contract);
q = q.WhereEqualTo("tokenId", tokenId);
q = q.OrderByDescending("createdAt");
q = q.Limit(1);
BuyPriceAcceptedEvent acceptedEvent = await q.FirstOrDefaultAsync(); 

I loose the 3 filters "whereEqualTo" as soon as the OrderByDescending is called.

I looked at the code and it seems that the internal constructor of the MoralisQuery create a new Filters Dictionary if the where is null

image

There is not this logic for "Includes" or "KeySelections" or "Orderings"

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

1 participant