You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -694,6 +694,19 @@ var people = _dbContext.People
694
694
.ToList();
695
695
```
696
696
697
+
## Using QueryKit on Enumerables
698
+
Since QueryKit is really just a parser for expressions, you can use it on any `IEnumerable<T>` as well. Just be sure to use the `ApplyQueryKitFilter` and `ApplyQueryKitSort` methods off of the enumerable.
699
+
700
+
For example
701
+
```csharp
702
+
var recipeOne = new FakeRecipeBuilder().Build();
703
+
var recipeTwo = new FakeRecipeBuilder().Build();
704
+
var listOfRecipes = new List<Recipe> { recipeOne, recipeTwo };
705
+
706
+
var input = $"""{nameof(Recipe.Title)} =="{recipeOne.Title}"""";
707
+
708
+
var filteredRecipes = listOfRecipes.ApplyQueryKitFilter(input).ToList();
0 commit comments