title: Using Linq to do a Contains with multiple values
body: <p>I have a medication table that I'm looking for certain drug names, but I need to search for multiple names.  Here is where I currently am with it.</p>
  
  <pre><code>string[] names = new string[2];
  names[0] = "apixaban";
  names[1] = "desirudin";
  
  var meds = (from m in Medications where names.Any(m.BrandName.Contains) || names.Any(m.GenericName.Contains) select m);
  </code></pre>
  
  <p>What I have isn't working, and I'm currently stuck.  I know I'm close, but I can't quite figure out what's wrong.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>For clarification, if the name I'm searching for is desirudin, then the BrandName or Generic name will be longer, so I have to have the contains on the field in the database.</p>
  
  <p><strong>EDIT 2</strong>
  Here is the error I recieve.</p>
  
  <pre><code>Unsupported overload used for query operator 'Any'.
  </code></pre>
  
  <p>Here is what I finally ended up with</p>
  
  <pre><code>var meds = (from m in db.AdmissionMedications where 
  (names.Any(n =&gt; m.BrandName.Contains(n)) || names.Any(n =&gt; m.GenericName.Contains(n))
  ) select m);
  </code></pre>