This is a migrated thread and some comments may be shown as answers.

Creating IN Queries with LINQ

1 Answer 108 Views
LINQ (LINQ specific questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dave
Top achievements
Rank 1
Dave asked on 23 Feb 2009, 11:57 PM

I'm having trouble working out how to create an IN Query with the ORM tool using LINQ:

var test = from o in scope.Extent<MyProductObject>()  
           where productlist.Contains(o.ProductID)  
           select o; 



In this case productlist is a list of ints that contain the product IDs that I wish to search on.

What is the best way to perform this query with the Telerik ORM tool?

1 Answer, 1 is accepted

Sort by
0
Thomas
Telerik team
answered on 24 Feb 2009, 09:34 AM
Hello Dave,

currently we do not support pushing the lists value to the server and you are right that in this case this could be done with an IN statement. The way to do it currently is to explicitly use an OR statement chain to test for the various values.
We are in the process of expanding our LINQ support, and your request has been noted.

Kind regards,
Thomas
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
LINQ (LINQ specific questions)
Asked by
Dave
Top achievements
Rank 1
Answers by
Thomas
Telerik team
Share this question
or