I am new to Linq to Sql and am trying to do the following in C #.
I have a table in which the key / value is stored (which also has fk for the user). I want to search with key names and values like or. At the front end, I let them add “filters”, which are key names, then they can look up the value. Thus, they can search for N elements, where N is the number of filters.
In plain sql, where N = 3, it will look like this. datakey and datavalue are columns in a table (varchar (255)).
SELECT * from table
where (datakey='option1' and datavalue='value1')
or (datakey='option2' and datavalue='value2')
or (datakey='option3' and datavalue='value3')
user258082
source
share