title: How to check if a list contains item in dynamic list using linq
body: <p>In a <code>dynamic</code> <code>List&lt;XElement&gt;</code> I want to get all the values that contains specific <code>attValue</code>.<br>
  To do that I'm using this:</p>
  
  <pre><code>return new DynamicXml(from item in _elements
                       where item.Attribute("attName").Value.Contains("attValue")
                       select item);
  </code></pre>
  
  <p>and To get attributes with more than one attribute value, I could use something like this:</p>
  
  <pre><code>return new DynamicXml(from item in _elements
                       where item.Attribute("attName").Value.Contains("attValue") ||
                             item.Attribute("attName").Value.Contains("attValue2")
                       select item);
  </code></pre>
  
  <p>all of the previous code works properly, now I'm trying to do the exact thing in the second code block, but instead of adding static conditions i need to pass a list that contains the attribute values, to get the values, but it returns wrong data.
  I tried to do it like this:</p>
  
  <ol>
  <li><p>This return all the value no matter what their attribute Values are.</p>
  
  <pre><code>return new DynamicXml(from item in _elements
                       where attValues.Any(v =&gt; v.Contains(item.Value))
                       select item);
  </code></pre></li>
  <li><p>This do not return anything:</p>
  
  <pre><code>return new DynamicXml(from item in _elements
                       where attValues.Contains(item.Value)
                       select item);
  </code></pre></li>
  </ol>
  
  <p><strong>Note:</strong> attValues is List</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>_<code>elements</code> contains properties like this:</p>
  
  <pre><code>&lt;property name="id" xpath="//Atom:entry/Atom:id"  disAtt="" mediaType="txt,pix"  isSingleSelection="true" /&gt;
  </code></pre>
  
  <p>the <code>attValues</code> contains <code>mediaTypes</code>:
  <code>"txt"</code> OR <code>"vid"</code> etc</p>
  
  <p>I need to get all the <code>properties</code> that have <code>mediaType</code> of type <code>txt</code> or <code>vid</code></p>
  
  <p><strong>Note:</strong> I can get the mediaType like this:</p>
  
  <pre><code>dynObject[0].property.mediaType.Value;
  </code></pre>