I got a question from a customer who wanted to create an ‘'IN” query(something like SELECT * FROM Address WHERE Postcode IN (2000, 1100, 1940, 1745)).
This is something you cannot do out-of-the-box using OData(not that I’m aware of). A possible alternative is using the AddQueryOption and build the filter condition yourself:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.AddQueryOption("$filter", "(Postcode eq 2000) or (Postcode eq 1100) or ..."); |
Remark: This only works if the list of elements is rather small.