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

[Feature] Filter by enumerated properties in the .net SDK [FIND-13264] #48

Closed
lounge opened this issue Sep 19, 2024 · 2 comments
Closed
Labels
Accepted Issue Accept issue to create JIRA ticket help wanted Extra attention is needed PR created Mark that PR has been created for review

Comments

@lounge
Copy link

lounge commented Sep 19, 2024

Is your feature request related to a problem? Please describe.
Is there a way to filter enumerated properties in the Where method of the .net SDK. In the docs it states only four filter options:

There are four implementations of IFilterOperator:

NumericFilterOperators: The filter operators for the Number field type. Optimizely Graph supports integer and float type.
BooleanFilterOperators: The filter operators for the Boolean field type.
DateFilterOperators: Filter operators for the DateTime field type.
StringFilterOperators: Filter operators for the String field type.

What we want to do is filter out content based on a list of Geta Categories.

Describe the solution you'd like
A way to filter content based on enumerated properties like a list of int or string.

Describe alternatives you've considered
We have considered querying with native graphQL queries directly with something like StrawberryShake. But it would be nice to have this feature in the .net SDK

Additional context
Add any other context or screenshots about the feature request here.

@lounge lounge added the help wanted Extra attention is needed label Sep 19, 2024
@ManhOptimizely
Copy link
Collaborator

ManhOptimizely commented Oct 17, 2024

Thanks for this request @lounge and sorry for the late response.
If you just need to filter content based on enumerated properties like a list of int or string, we're currently supported it in FilterExtension by using EPiServer.ContentGraph.Extensions. Lets try like this: .Where(x=>x.EnumerableOfStrings.Like("something")).
We're now trying to support IEnumerable of the complex type.

@ManhOptimizely ManhOptimizely added Accepted Issue Accept issue to create JIRA ticket enhancement New feature or request and removed Accepted Issue Accept issue to create JIRA ticket labels Oct 17, 2024
@github-actions github-actions bot changed the title [Feature] Filter by enumerated properties in the .net SDK [Feature] Filter by enumerated properties in the .net SDK [FIND-13264] Oct 17, 2024
@ManhOptimizely ManhOptimizely added PR created Mark that PR has been created for review and removed enhancement New feature or request labels Oct 17, 2024
@ManhOptimizely
Copy link
Collaborator

Hi @lounge,
For dealing with IEnumerable properties, I've a blog post https://world.optimizely.com/blogs/manh-nguyen/dates/2024/4/optimizely-graph-client-dealing-with-cms-data-models-for-query-builder/ to show the easiest way to work.
I've also added new methods for allowing filters on IEnumerable of a complex type on version Optimizely.Graph.Client1.3.0, please install new version to try.
For example:
.Where(x=> x.EnumerableField, x=>x.PropertyOfComplexType.Like("demo"))
Please visit docs https://docs.developers.optimizely.com/platform-optimizely/v1.4.0-optimizely-graph/docs/where-filter for more details (maybe you should wait a few days for the documentation to be public).
Feel free to open new Issues if you need anything else or open a discussion if you have questions about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Issue Accept issue to create JIRA ticket help wanted Extra attention is needed PR created Mark that PR has been created for review
Projects
None yet
Development

No branches or pull requests

2 participants