episerver / graph-net-sdk

Net client APIs for Optimizely Graph with sample sites, Free and Open
https://docs.developers.optimizely.com/platform-optimizely/v1.4.0-optimizely-graph/docs/introduction
Apache License 2.0
6 stars 3 forks source link

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

Open lounge opened 1 month ago

lounge commented 1 month ago

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.

ManhOptimizely commented 3 days ago

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.