Skip to content

Commit 91ce457

Browse files
committed
docs: nested collections
1 parent 81e54b7 commit 91ce457

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,23 @@ By default, QueryKit will use `Any` under the hood when building this filter, bu
195195
var input = """"Ingredients.Stock %>= 1"""";
196196
```
197197

198-
> 🚧 At the moment, nested collections like `Ingredients.Suppliers.Rating > 4` is still under active development
198+
Nested collections can also be filtered:
199+
200+
```csharp
201+
var input = $"""preparations == "{preparationOne.Text}" """;
202+
var config = new QueryKitConfiguration(settings =>
203+
{
204+
settings.Property<Recipe>(x => x.Ingredients
205+
.SelectMany(y => y.Preparations)
206+
.Select(y => y.Text))
207+
.HasQueryName("preparations");
208+
});
209+
210+
// Act
211+
var queryableRecipes = testingServiceScope.DbContext().Recipes;
212+
var appliedQueryable = queryableRecipes.ApplyQueryKitFilter(input, config);
213+
var recipes = await appliedQueryable.ToListAsync();
214+
```
199215

200216
If you want to filter a primitve collection like `List<string>` you can use the `Has` or `DoesNotHave` operator (can be case insensitive with the appended `*`):
201217

0 commit comments

Comments
 (0)