nave

nave

  • NA
  • 9.5k
  • 0

LINQ quary question

Jul 30 2013 2:44 PM
in my db i have a table with column (string) containing the ID (key) of another table.
column string content is in the form of > 1,2,3 exc...

lets say i nave table "TABLEA":
NAME    FIELDS
john     1                  
bob      1,2

i'm passing the "itemFilter" quary in order to find all items in the table that column "FIELDS" match one or more ID's:

var itemFilter = "1";

query = query.Where(c => c.TABLEA.FIELDS.Contains(itemFilter));

"itemFilter" needs to bring back results for both john and bob but this is not working properly.

i belive this quary creates "AND" relation but i need to get an "OR" relation in order to get all items that match one or mote ID's in the array.

how do i do that?

Answers (5)