c# - dynamic number of where clause conditions in linq to sql -


I am trying to find the data table for all the entries that have a list of words. There may be a variable number of words in the list. Here's my code:

  string [] word = initial string (''); Foreign currency (word of the word string) {list & lt; Mrconso_SnoMed2014 & gt; Curmatches = (One of Master DB for MrConso_SnoMed2014, where a.STR.ToLower () contains it (word toLower (). Trim ()) Select one) .list (); Matches.AddRange (curMatches); }  

This code is taking too long to execute. All database calls are taking time. I would like to use some dynamic query that has a variable number where the section is something like this:

  list & lt; Mrconso_SnoMed2014 & gt; Curmentches = (One of Master DB in Mrconso_noMed2014 where a.STR.ToLower () contains it (word [0] .over (). Trim ()) or a.STR.ToLower (). In it (the word [1]. (.) Trim ()) ... Select a) .Olist (); You can use the interface from LINQ, something looks like:     

list1 Select (s = & gt; s.STR.ToLower). Exclude (list2.Select (s = & gt; s.ToLower). Trim ()))

Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

list Class in C++ -