I am stumped by this :) ...

3 posts, 1 answers
  1. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 04 Jun 2014 Link to this post

    Okay so here's the problem...

    I have a column\property called "Site" of type string

    I also have a List<string> with 3 items in it

    So I need to return all the objects whos "Site" has any of the strings in the List.

    Does that make sense?
  2. Answer
    Viktor Zhivkov
    Admin
    Viktor Zhivkov avatar
    291 posts

    Posted 06 Jun 2014 Link to this post

    Hello Steve,

    You can easily implement such query using IEnumerable.Contains():
    List<string> siteList = new List<string>() { "site1", "site2", "site3" };
    var query = from c context.Endpoint
             where siteList.Contains(c.Site)
             select c;

    You can find more information about our implementation for handling IEnumerable.Contains() in this online documentation article.

    Regards,
    Viktor Zhivkov
    Telerik
     
    OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
     
  3. DevCraft banner
  4. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 06 Jun 2014 in reply to Viktor Zhivkov Link to this post

    GAH, yeah that was it, thx :)
Back to Top