title: LINQ return records where string[] values match Comma Delimited String Field
body: <p>I am trying to select some records using LINQ for Entities (EF4 Code First).</p>
  
  <p>I have a table called Monitoring with a field called AnimalType which has values such as</p>
  
  <ul>
  <li>"Lion,Tiger,Goat"</li>
  <li>"Snake,Lion,Horse"</li>
  <li>"Rattlesnake"</li>
  <li>"Mountain Lion"</li>
  </ul>
  
  <p>I want to pass in some values in a string array (animalValues) and have the rows returned from the Monitorings table where one or more values in the field AnimalType match the one or more values from the animalValues. The following code ALMOST works as I wanted but I've discovered a major flaw with the approach I've taken.</p>
  
  <pre><code>public IQueryable&lt;Monitoring&gt; GetMonitoringList(string[] animalValues)
      {
          var result = from m in db.Monitorings
                       where animalValues.Any(c =&gt; m.AnimalType.Contains(c))
                       select m;
          return result;
      }
  </code></pre>
  
  <p>To explain the problem, if I pass in animalValues = { "Lion", "Tiger" } I find that three rows are selected due to the fact that the 4th record "Mountain Lion" contains the word "Lion" which it regards as a match.</p>
  
  <p>This isn't what I wanted to happen. I need "Lion" to only match "Lion" and not "Mountain Lion".</p>
  
  <p>Another example is if I pass in "Snake" I get rows which include "Rattlesnake". I'm hoping somebody has a better bit of LINQ code that will allow for matches that match the exact comma delimited value and not just a part of it as in "Snake" matching "Rattlesnake".</p>