Creating IN Queries with LINQ

2 posts, 0 answers
  1. Dave
    Dave avatar
    1 posts
    Member since:
    Feb 2009

    Posted 23 Feb 2009 Link to this post

    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?
  2. Thomas
    Thomas avatar
    588 posts

    Posted 24 Feb 2009 Link to this post

    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,
    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.
  3. DevCraft banner
Back to Top