Skip to content

Conversation

@BenoitLacour
Copy link

Hello,

This is a proposal to add a simple where filter to filter on indexed fields. I needed it to make an app I work on faster to recover entities linked data.

Maybe I'm wrong and it has already another solution, but didn't find it so this PR could help other users.

Best regards,
Benoît

Copy link
Owner

@nwestfall nwestfall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of it I have to test, but let me know your thoughts. Love the contribution!

Change the way the filter json object is generated + some small corrections
@BenoitLacour
Copy link
Author

@nwestfall Did you see my updates?

@etaxi341
Copy link
Contributor

etaxi341 commented Sep 7, 2021

Any news on this?

@nwestfall
Copy link
Owner

Sorry for the delay guys, had a few other projects come up. I'm pulling the code and taking a look to try and get this out.

Copy link
Owner

@nwestfall nwestfall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think just fix the build and this will be good to go. Like the approach you took for theIndexFilterValue

/// <returns></returns>
public async Task<IList<TRecord>> Where<TRecord>(string storeName, string indexName, object filterValue)
{
var filters = new List<IndexFilterValue>() {new(indexName, filterValue)};
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What version of C# is this? I don't think I'm using it yet, but I'm always happy to update this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a C# 9.0 feature, maybe not ideal to use on a project that target .Net Core 3.1 but it is compatible with.

@nwestfall nwestfall merged commit 2d376b8 into nwestfall:master Sep 9, 2021
@nwestfall
Copy link
Owner

@BenoitLacour never mind, I did not mean to merge this, not sure what happened. But now that it's in master, I can go ahead and fix it. Thanks!

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

Successfully merging this pull request may close these issues.

3 participants