title: LINQ case sensitive
body: <p>How to make LINQ case sensitive and NOT case sensitive depending on the situation?</p>
  
  <p>I'm using sql server 2008 and Entity Framework 4.0.</p>
  
  <p>I changed the COLLATION to make SQL Server case sensitive. so that for scenarios like these:</p>
  
  <pre><code> query = query.Where(x =&gt; x.Username == username);
  </code></pre>
  
  <p>it works great.
  However I need to be able to pull out data from db <strong>ignoring case</strong> when searching by subject (or name or similar) like so:</p>
  
  <pre><code>query = query.Where(x =&gt; (x.Name.Contains(Name)));
  </code></pre>
  
  <p>which doesn't work when record is "TestString" and i'm looking for "test" or "Test" or similar. How would i make it so that when it would find a text or part of a string in a text?
  thanks</p>