title: LINQ query over generic list of user types
body: <p>I wish to search to see if a string called <code>tempName</code> is already contained in a List of user objects. These user objects of type <code>userClass</code> contain a string data method <code>Name</code> whose value i'd like to check against <code>tempName</code>.</p>
  
  <p>How is this done in LINQ?</p>
  
  <p>thanks</p>
  
  <p>Using traditional for loops i can do it like this:</p>
  
  <pre><code>bool already = false;
  for (int i = 0; i &lt; userList.Count; i++)
  {
      if (Name == userList[i].name) 
          already = true;
  }
  </code></pre>