The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I need to query an OData source to return records whose ID is in a list. I assume this is possible with a Query, but I can't find the correct syntax. Any help would be appreciated.
Could you please post an example? If I have an array
[2, 3, 4. 8, 9, 10, ...]
and a table as such:
ProductId,
CustomerId,
ProductName,
...
and I want all results where the customer_id is in that array...?
-k
PSPavithra Subramaniyam Syncfusion Team October 4, 2019 12:15 PM UTC
Hi Kelly,
Thanks for your update.
By default one to many filtering is not supported in EJ2 DataManager. So we could not query the array values using DataManager which is the default behavior.
By default one to many filtering is not supported in EJ2 DataManager. So we could not query the array values using DataManager which is the default behavior.
Regards,
Pavithra S.
Is there a way to manipulate the OData query uri directly then? It does appear that OData supports the 'IN' option:
http://host/service/Products?$filter=Name in ('Milk', 'Cheese')
PSPavithra Subramaniyam Syncfusion Team October 7, 2019 09:34 AM UTC
Hi Kelly,
Thanks for your update.
Yes. You can achieve your requirement by using predicate which helps to build complex filter Query. Please refer the following documentation link for more information.
Sometimes the built-in adaptors does not meet your requirement. In such cases you can create your own adaptor. Please refer the below documentation link for more information. You can override the default Query of the Odata Adaptor by overriding processQuery and processResponse methods.