If I understood you correctly you would like to filter Customers
by their Addresses' ZipCode
. Could you please confirm that?
If that is the case one possibility to achieve such behavior is to use the Dynamic LINQ equivalent to the Any
method. For examples:
"Name.Length > 10"
" AND Addresses.Any(ZipCode == "
queryString = previousFilters + zipCodeFilter
customers = dbContext.Customers.Where(queryString).ToList()
This query would return all customers that have at least one address with ZipCode
that is equal to 1000
(in addition to any previous filters).
For more information and examples on how to use Dynamic LINQ
with Telerik Data Access I would suggest you to take a look at our Samples Kit
(under the LINQ category).
I hope this helps. Do not hesitate to contact us again if you have need any further assistance.
Telerik has recently updated some of its product names. OpenAccess ORM is now Telerik Data Access
. For more information on the new names, please, check out the Telerik Product Map